Skip to contentSkip to conversation

drivers/serial: Move conditional compilation to Makefile for CONFIG_* macros

PATCH New Jean-Christophe PLAGNIOL-VILLARD 2 participants 10 messages Aug 2, 2008 – Aug 3, 2008 Arm/Microchip (AT91) SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/serial: Move conditional compilation to Makefile for CONFIG_* macros

---
Need to build nios2

I've prefer to move conditional compilation to Makefile instead of you move an include in xuartlite. Which is not related to nios2.

I've choose to only move the CONFIG_ and merge the CFG_ in a second step during the next merge

 drivers/serial/Makefile           |   12 ++++++------
 drivers/serial/atmel_usart.c      |    3 ---
 drivers/serial/mcfuart.c          |    3 ---
 drivers/serial/s3c4510b_uart.c    |    4 ----
 drivers/serial/serial_max3100.c   |    4 ----
 drivers/serial/serial_xuartlite.c |    4 ----
 drivers/serial/usbtty.c           |    5 -----
 7 files changed, 6 insertions(+), 29 deletions(-)
drivers/serial/Makefile +6 -6
index c9e797e..de6fbab 100644
@@ -25,18 +25,18 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libserial.a
 
-COBJS-y += atmel_usart.o
-COBJS-y += mcfuart.o
+COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
+COBJS-$(CONFIG_MCFUART) += mcfuart.o
 COBJS-y += ns9750_serial.o
 COBJS-y += ns16550.o
-COBJS-y += s3c4510b_uart.o
+COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-y += serial.o
-COBJS-y += serial_max3100.o
+COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-y += serial_pl010.o
 COBJS-y += serial_pl011.o
-COBJS-y += serial_xuartlite.o
+COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-y += serial_sh.o
-COBJS-y += usbtty.o
+COBJS-$(CONFIG_USB_TTY) += usbtty.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/serial/atmel_usart.c +0 -3
index f35b997..f3b146c 100644
@@ -17,7 +17,6 @@
  */
 #include <common.h>
 
-#ifdef CONFIG_ATMEL_USART
 #include <asm/io.h>
 #include <asm/arch/clk.h>
 #include <asm/arch/memory-map.h>
@@ -96,5 +95,3 @@ int serial_tstc(void)
 {
 	return (usart3_readl(CSR) & USART3_BIT(RXRDY)) != 0;
 }
-
-#endif /* CONFIG_ATMEL_USART */
drivers/serial/mcfuart.c +0 -3
index 5eb4f45..a1fcd05 100644
@@ -29,8 +29,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_MCFUART
-
 #include <asm/immap.h>
 #include <asm/uart.h>
 
@@ -130,4 +128,3 @@ void serial_setbrg(void)
 
 	uart->ucr = UART_UCR_RX_ENABLED | UART_UCR_TX_ENABLED;
 }
-#endif				/* CONFIG_MCFUART */
drivers/serial/s3c4510b_uart.c +0 -4
index ddcd591..aa378e1 100644
@@ -45,8 +45,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_DRIVER_S3C4510_UART
-
 #include <asm/hardware.h>
 #include "s3c4510b_uart.h"
 
@@ -212,5 +210,3 @@ void serial_puts (const char *s)
 	uart->m_ctrl.bf.sendBreak = 0;
 
 }
-
-#endif
drivers/serial/serial_max3100.c +0 -4
index 0611fc1..4abc271 100644
@@ -26,8 +26,6 @@
 #include <common.h>
 #include <watchdog.h>
 
-#ifdef CONFIG_MAX3100_SERIAL
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /**************************************************************/
@@ -298,5 +296,3 @@ int serial_tstc(void)
 void serial_setbrg(void)
 {
 }
-
-#endif
drivers/serial/serial_xuartlite.c +0 -4
index 74546ce..00d0eaa 100644
@@ -27,8 +27,6 @@
 #include <config.h>
 #include <asm/io.h>
 
-#ifdef	CONFIG_XILINX_UARTLITE
-
 #define RX_FIFO_OFFSET		0 /* receive FIFO, read only */
 #define TX_FIFO_OFFSET		4 /* transmit FIFO, write only */
 #define STATUS_REG_OFFSET	8 /* status register, read only */
@@ -77,5 +75,3 @@ int serial_tstc(void)
 {
 	return (in_be32((u32 *) UARTLITE_STATUS) & SR_RX_FIFO_VALID_DATA);
 }
-
-#endif	/* CONFIG_MICROBLZE */
drivers/serial/usbtty.c +0 -5
index 2bc5c3c..e738c56 100644
@@ -23,8 +23,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_USB_TTY
-
 #include <circbuf.h>
 #include <devices.h>
 #include "usbtty.h"
@@ -1007,6 +1005,3 @@ void usbtty_poll (void)
 	udc_irq();
 
 }
-
-
-#endif
Signature · 1 line
1.5.6.2
#1 lore raw

PATCH 1/1 nios2: fix phys_addr_t and phys_size_t support

---
 cpu/nios2/interrupts.c    |    1 +
 include/asm-nios2/types.h |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
cpu/nios2/interrupts.c +1 -0
index aeb5b65..ec5db31 100644
@@ -27,6 +27,7 @@
 
 #include <nios2.h>
 #include <nios2-io.h>
+#include <asm/types.h>
 #include <asm/io.h>
 #include <asm/ptrace.h>
 #include <common.h>
include/asm-nios2/types.h +3 -0
index f13d8bd..ea859c0 100644
@@ -52,6 +52,9 @@ typedef unsigned long long u64;
 /* Dma addresses are 32-bits wide.  */
 
 typedef u32 dma_addr_t;
+
+typedef unsigned long phys_addr_t;
+typedef unsigned long phys_size_t;
 #endif /* __KERNEL__ */
 
 #endif /* __ASM_NIOS2_TYPES_H */
Signature · 1 line
1.5.6.2
#2 lore raw

PATCH 1/1 nios2/sysid: fix printf warning

---
 cpu/nios2/sysid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
cpu/nios2/sysid.c +1 -1
index b5a2959..697ed03 100644
@@ -40,7 +40,7 @@ void display_sysid (void)
 	stamp = readl (&sysid->timestamp);
 	localtime_r (&stamp, &t);
 	asctime_r (&t, asc);
-	printf ("SYSID : %08x, %s", readl (&sysid->id), asc);
+	printf ("SYSID : %08lx, %s", readl (&sysid->id), asc);
 
 }
 
Signature · 1 line
1.5.6.2
#3 lore raw

PATCH 1/1 Fix remaining build issues with MPC8xx FADS boards.

---
 include/configs/FADS860T.h  |    2 +-
 include/configs/MPC86xADS.h |    2 +-
 include/configs/MPC885ADS.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
include/configs/FADS860T.h +1 -1
index 18de6b0..38295c4 100644
@@ -38,7 +38,7 @@
 #define CONFIG_DRAM_50MHZ		1
 #define CONFIG_SDRAM_50MHZ              1
 
-#include "fads.h"
+#include "../../board/fads/fads.h"
 
 #ifdef USE_REAL_FLASH_VALUES
 /*
include/configs/MPC86xADS.h +1 -1
index e0e8554..233a8d1 100644
@@ -41,7 +41,7 @@
 #define CONFIG_DRAM_50MHZ       1
 #define CONFIG_SDRAM_50MHZ      1
 
-#include "fads.h"
+#include "../../board/fads/fads.h"
 
 #define CFG_OR5_PRELIM		0xFFFF8110	/* 64Kbyte address space */
 #define CFG_BR5_PRELIM		(CFG_PHYDEV_ADDR | BR_PS_8 | BR_V)
include/configs/MPC885ADS.h +1 -1
index 1867c5b..f4d1842 100644
@@ -27,7 +27,7 @@
 
 #define CONFIG_SDRAM_50MHZ      1
 
-#include "fads.h"
+#include "../../board/fads/fads.h"
 
 #define CFG_OR5_PRELIM		0xFFFF8110	/* 64Kbyte address space */
 #define CFG_BR5_PRELIM		(CFG_PHYDEV_ADDR | BR_PS_8 | BR_V)
Signature · 1 line
1.5.6.2
#4 lore raw

PATCH 1/1 mvbc_p: Fix problem with '#if (CONFIG_CMD_KGDB)'

---
 include/configs/MVBC_P.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/configs/MVBC_P.h +2 -2
index 48f427e..8c8a445 100644
@@ -40,7 +40,7 @@
 #define CONFIG_MISC_INIT_R	1
 
 #define CFG_CACHELINE_SIZE	32
-#if (CONFIG_CMD_KGDB)
+#ifdef (CONFIG_CMD_KGDB)
 #define CFG_CACHELINE_SHIFT	5
 #endif
 
@@ -268,7 +268,7 @@
 #define CFG_PROMPT_HUSH_PS2 	"> "
 #undef 	CFG_LONGHELP
 #define CFG_PROMPT		"=> "
-#if (CONFIG_CMD_KGDB)
+#ifdef (CONFIG_CMD_KGDB)
 #define CFG_CBSIZE		1024
 #else
 #define CFG_CBSIZE		256
Signature · 1 line
1.5.6.2
#5 lore raw

PATCH 1/1 mvbc_p: Fix problem with '#if (CONFIG_CMD_KGDB)'

Quoted 4 lines · In message <[email protected]> you wrote:
---
 include/configs/MVBC_P.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Where humor is concerned there are no standards -- no  one  can  say
what is good or bad, although you can be sure that everyone will.
- John Kenneth Galbraith
#6 lore raw

PATCH 1/1 Fix remaining build issues with MPC8xx FADS boards.

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 6 lines · In message <[email protected]> you wrote:
---
 include/configs/FADS860T.h  |    2 +-
 include/configs/MPC86xADS.h |    2 +-
 include/configs/MPC885ADS.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Houston, Tranquillity Base here.  The Eagle has landed.
                                                    -- Neil Armstrong
#7 lore raw

PATCH 1/1 nios2/sysid: fix printf warning

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · In message <[email protected]> you wrote:
---
 cpu/nios2/sysid.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The Buddha, the Godhead, resides quite as comfortably in the circuits
of a digital computer or the gears of a cycle transmission as he does
at the top of a mountain or in the petals of a flower.
            - R.  Pirsig, "Zen and the Art of Motorcycle Maintenance"
#8 lore raw

PATCH 1/1 nios2: fix phys_addr_t and phys_size_t support

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · In message <[email protected]> you wrote:
---
 cpu/nios2/interrupts.c    |    1 +
 include/asm-nios2/types.h |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Administration: An ingenious abstraction  in  politics,  designed  to
receive the kicks and cuffs due to the premier or president.
- Ambrose Bierce
#9 lore raw

PATCH 1/1 drivers/serial: Move conditional compilation to Makefile for CONFIG_* macros

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 8 lines · In message <[email protected]> you wrote:

---
Need to build nios2

I've prefer to move conditional compilation to Makefile instead of you move an include in xuartlite. Which is not related to nios2.

I've choose to only move the CONFIG_ and merge the CFG_ in a second step during the next merge

OK.

Quoted 8 lines
 drivers/serial/Makefile           |   12 ++++++------
 drivers/serial/atmel_usart.c      |    3 ---
 drivers/serial/mcfuart.c          |    3 ---
 drivers/serial/s3c4510b_uart.c    |    4 ----
 drivers/serial/serial_max3100.c   |    4 ----
 drivers/serial/serial_xuartlite.c |    4 ----
 drivers/serial/usbtty.c           |    5 -----
 7 files changed, 6 insertions(+), 29 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
All this doesn't alter anything, you know. The world is still full of
stupid people. They don't use their brains. They don't seem  to  want
to think straight.                    - Terry Pratchett, _Soul Music_