Skip to content

Commit

Permalink
[lib][device] Part 1: Rename all mentions of serial to uart
Browse files Browse the repository at this point in the history
  • Loading branch information
b-man committed Oct 18, 2017
1 parent 9bb8a1f commit 04ae29f
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 31 deletions.
4 changes: 1 addition & 3 deletions bsp/raspberrypi2/bsp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ C_SRC_FILES := \
C_SRCS += $(addprefix $(SRC_DIR)/, $(C_SRC_FILES))

include $(SRCROOT)/driver/timer/bcm_timer/module.mk
include $(SRCROOT)/driver/serial/pl011/module.mk


include $(SRCROOT)/driver/uart/pl011/module.mk
6 changes: 3 additions & 3 deletions bsp/raspberrypi2/config.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Raspberry Pi2-specific configuration information
*
* Copyright (c) 2013, Brian McKenzie <mckenzba@gmail.com>
* Copyright (c) 2017, Brian McKenzie <mckenzba@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -39,10 +39,10 @@
#include <boot/bsp.h>

#include <device/timer.h>
#include <device/serial.h>
#include <device/uart.h>
#include <device/sysctl.h>

#include <driver/serial/pl011/pl011.h>
#include <driver/uart/pl011/pl011.h>
#include <driver/timer/bcm_timer/bcm_timer.h>

#include "bcm2836.h"
Expand Down
2 changes: 1 addition & 1 deletion bsp/realview-pba8/bsp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ C_SRC_FILES := \
C_SRCS += $(addprefix $(SRC_DIR)/, $(C_SRC_FILES))

include $(SRCROOT)/driver/timer/sp804/module.mk
include $(SRCROOT)/driver/serial/pl011/module.mk
include $(SRCROOT)/driver/uart/pl011/module.mk
4 changes: 2 additions & 2 deletions bsp/realview-pba8/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
#include <boot/bsp.h>

#include <device/timer.h>
#include <device/serial.h>
#include <device/uart.h>
#include <device/sysctl.h>

#include <driver/uart/pl011/pl011.h>
#include <driver/timer/sp804/sp804.h>
#include <driver/serial/pl011/pl011.h>

#include "rvpba8.h"
#include "realview-pba8.h"
Expand Down
2 changes: 1 addition & 1 deletion bsp/snowball/bsp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ C_SRC_FILES := \
C_SRCS += $(addprefix $(SRC_DIR)/, $(C_SRC_FILES))

include $(SRCROOT)/driver/timer/ste_mtu/module.mk
include $(SRCROOT)/driver/serial/pl011/module.mk
include $(SRCROOT)/driver/uart/pl011/module.mk
4 changes: 2 additions & 2 deletions bsp/snowball/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@

#include <device/timer.h>
#include <device/sysctl.h>
#include <device/serial.h>
#include <device/uart.h>

#include <driver/serial/pl011/pl011.h>
#include <driver/uart/pl011/pl011.h>
#include <driver/timer/ste_mtu/ste_mtu.h>

#include "ap9500.h"
Expand Down
2 changes: 1 addition & 1 deletion core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <boot/boot.h>

#include <device/timer.h>
#include <device/serial.h>
#include <device/uart.h>

#define SHELL_PROMPT "] "

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SRC_DIR := $(SRCROOT)/driver/serial/pl011
SRC_DIR := $(SRCROOT)/driver/uart/pl011

C_SRC_FILES := \
pl011.c
Expand Down
10 changes: 5 additions & 5 deletions driver/serial/pl011/pl011.c → driver/uart/pl011/pl011.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* PL011 serial driver
/* PL011 UART driver
*
* Copyright (c) 2013, Brian McKenzie <mckenzba@gmail.com>
* Copyright (c) 2017, Brian McKenzie <mckenzba@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -34,7 +34,7 @@
#include <sys/io.h>
#include <sys/types.h>

#include <device/serial.h>
#include <device/uart.h>

#include "pl011.h"

Expand Down Expand Up @@ -99,7 +99,7 @@ void pl011_rx_interrupt_mask(bool state)
pl011_cfg *config = &pl011_config;
addr_t base = config->base;

if (state == TRUE)
if (state == true)
writel((base + UART_IMSC), (UART_IMSC_RXMS));
else
writel((base + UART_IMSC), (UART_IMSC_RXMS & ~UART_IMSC_RXMS));
Expand All @@ -115,7 +115,7 @@ void pl011_tx_interrupt_mask(bool state)
pl011_cfg *config = &pl011_config;
addr_t base = config->base;

if (state == TRUE)
if (state == true)
writel((base + UART_IMSC), (UART_IMSC_TXMS));
else
writel((base + UART_IMSC), (UART_IMSC_TXMS & ~UART_IMSC_TXMS));
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions include/device/serial.h → include/device/uart.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Serial device api
/* UART device api
*
* Copyright (c) 2013, Brian McKenzie <mckenzba@gmail.com>
* Copyright (c) 2017, Brian McKenzie <mckenzba@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -29,8 +29,8 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef SERIAL_H
#define SERIAL_H
#ifndef UART_H
#define UART_H

#include <sys/types.h>

Expand All @@ -50,4 +50,4 @@ extern uint32_t serial_getc(void);
extern void serial_putc(int c);
extern void serial_puts(const char *str);

#endif /* !SERIAL_H */
#endif /* !UART_H */
4 changes: 2 additions & 2 deletions lib/crt/stdio/printf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Basic printf for xBoot
*
* Copyright (c) 2014, Brian McKenzie <mckenzba@gmail.com>
* Copyright (c) 2017, Brian McKenzie <mckenzba@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -39,7 +39,7 @@
#include <stdbool.h>
#include <string.h>

#include <device/serial.h>
#include <device/uart.h>

/* putc function to use */
static void (*putchar)(int c);
Expand Down
2 changes: 1 addition & 1 deletion lib/device/module.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SRC_DIR := $(SRCROOT)/lib/device

C_SRC_FILES := \
serial.c \
uart.c \
sysctl.c \
timer.c \
nvram.c
Expand Down
6 changes: 3 additions & 3 deletions lib/device/serial.c → lib/device/uart.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Generic serial driver interface
/* Generic UART driver interface
*
* Copyright (c) 2013, Brian McKenzie <mckenzba@gmail.com>
* Copyright (c) 2017, Brian McKenzie <mckenzba@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -30,7 +30,7 @@
*/

#include <sys/types.h>
#include <device/serial.h>
#include <device/uart.h>

extern serial_driver serial_drv;
static serial_driver *serial = &serial_drv;
Expand Down
2 changes: 1 addition & 1 deletion lib/shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include <shell.h>

#include <device/serial.h>
#include <device/uart.h>

/**
* shell_getline
Expand Down

0 comments on commit 04ae29f

Please sign in to comment.