diff mbox

[U-Boot] microblaze: Enable SERIAL_MULTI

Message ID 1318231036-11639-2-git-send-email-monstr@monstr.eu
State Superseded
Delegated to: Michal Simek
Headers show

Commit Message

Michal Simek Oct. 10, 2011, 7:17 a.m. UTC
Enable support for SERIAL_MULTI.

Microblaze can use uart16550 and uartlite drivers.

Signed-off-by: Michal Simek <monstr@monstr.eu>

---
Note:
 Follow serial.h conding style.
---
 arch/microblaze/lib/board.c          |    4 ++++
 include/configs/microblaze-generic.h |    2 ++
 include/serial.h                     |    2 +-
 3 files changed, 7 insertions(+), 1 deletions(-)

Comments

Graeme Russ Oct. 10, 2011, 10:11 a.m. UTC | #1
On 10/10/11, Michal Simek <monstr@monstr.eu> wrote:
> Enable support for SERIAL_MULTI.
>
> Microblaze can use uart16550 and uartlite drivers.
>
> Signed-off-by: Michal Simek <monstr@monstr.eu>
>
> ---
> Note:
>  Follow serial.h conding style.
> ---
>  arch/microblaze/lib/board.c          |    4 ++++
>  include/configs/microblaze-generic.h |    2 ++
>  include/serial.h                     |    2 +-
>  3 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
> index ca5882d..64089c8 100644
> --- a/arch/microblaze/lib/board.c
> +++ b/arch/microblaze/lib/board.c
> @@ -32,6 +32,7 @@
>  #include <stdio_dev.h>
>  #include <net.h>
>  #include <asm/processor.h>
> +#include <serial.h>
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> @@ -110,6 +111,9 @@ void board_init (void)
>
>  	monitor_flash_len = __end - __text_start;
>
> +#ifdef CONFIG_SERIAL_MULTI
> +	serial_initialize();
> +#endif
>  	/*
>  	 * The Malloc area is immediately below the monitor copy in DRAM
>  	 * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off
> diff --git a/include/configs/microblaze-generic.h
> b/include/configs/microblaze-generic.h
> index 6b3fd76..89657189 100644
> --- a/include/configs/microblaze-generic.h
> +++ b/include/configs/microblaze-generic.h
> @@ -31,6 +31,8 @@
>  #define	CONFIG_MICROBLAZE	1
>  #define	MICROBLAZE_V5		1
>
> +#define CONFIG_SERIAL_MULTI 1
> +
>  /* uart */
>  #ifdef XILINX_UARTLITE_BASEADDR
>  # define CONFIG_XILINX_UARTLITE
> diff --git a/include/serial.h b/include/serial.h
> index 5926244..f047d2f 100644
> --- a/include/serial.h
> +++ b/include/serial.h
> @@ -31,7 +31,7 @@ extern struct serial_device * default_serial_console
> (void);
>      defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
>      defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
>      defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
> -    defined(CONFIG_TEGRA2)
> +    defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE)

Am I the only one that thinks this is all really ugly?

>  extern struct serial_device serial0_device;
>  extern struct serial_device serial1_device;
>  #if defined(CONFIG_SYS_NS16550_SERIAL)
> --
> 1.7.5.4

Regards,

Graeme
Michal Simek Oct. 10, 2011, 10:52 a.m. UTC | #2
Graeme Russ wrote:
> On 10/10/11, Michal Simek <monstr@monstr.eu> wrote:
>> Enable support for SERIAL_MULTI.
>>
>> Microblaze can use uart16550 and uartlite drivers.
>>
>> Signed-off-by: Michal Simek <monstr@monstr.eu>
>>
>> ---
>> Note:
>>  Follow serial.h conding style.
>> ---
>>  arch/microblaze/lib/board.c          |    4 ++++
>>  include/configs/microblaze-generic.h |    2 ++
>>  include/serial.h                     |    2 +-
>>  3 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
>> index ca5882d..64089c8 100644
>> --- a/arch/microblaze/lib/board.c
>> +++ b/arch/microblaze/lib/board.c
>> @@ -32,6 +32,7 @@
>>  #include <stdio_dev.h>
>>  #include <net.h>
>>  #include <asm/processor.h>
>> +#include <serial.h>
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> @@ -110,6 +111,9 @@ void board_init (void)
>>
>>  	monitor_flash_len = __end - __text_start;
>>
>> +#ifdef CONFIG_SERIAL_MULTI
>> +	serial_initialize();
>> +#endif
>>  	/*
>>  	 * The Malloc area is immediately below the monitor copy in DRAM
>>  	 * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off
>> diff --git a/include/configs/microblaze-generic.h
>> b/include/configs/microblaze-generic.h
>> index 6b3fd76..89657189 100644
>> --- a/include/configs/microblaze-generic.h
>> +++ b/include/configs/microblaze-generic.h
>> @@ -31,6 +31,8 @@
>>  #define	CONFIG_MICROBLAZE	1
>>  #define	MICROBLAZE_V5		1
>>
>> +#define CONFIG_SERIAL_MULTI 1
>> +
>>  /* uart */
>>  #ifdef XILINX_UARTLITE_BASEADDR
>>  # define CONFIG_XILINX_UARTLITE
>> diff --git a/include/serial.h b/include/serial.h
>> index 5926244..f047d2f 100644
>> --- a/include/serial.h
>> +++ b/include/serial.h
>> @@ -31,7 +31,7 @@ extern struct serial_device * default_serial_console
>> (void);
>>      defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
>>      defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
>>      defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
>> -    defined(CONFIG_TEGRA2)
>> +    defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE)
> 
> Am I the only one that thinks this is all really ugly?

I hope you mean serial.h not mb code.

I agree with you but not sure if we can remove all ifdefs there.


Thanks,
Michal
Wolfgang Denk Oct. 10, 2011, 12:57 p.m. UTC | #3
Dear Michal Simek,

In message <4E92CE64.5000609@monstr.eu> you wrote:
>
> >>      defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
> >>      defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
> >>      defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
> >> -    defined(CONFIG_TEGRA2)
> >> +    defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE)
> > 
> > Am I the only one that thinks this is all really ugly?
> 
> I hope you mean serial.h not mb code.
> 
> I agree with you but not sure if we can remove all ifdefs there.

The long list of device specific ifdef's should be converted into a
single ifdef testing for a specific feature instead.

Best regards,

Wolfgang Denk
Mike Frysinger Oct. 10, 2011, 3:18 p.m. UTC | #4
On Monday 10 October 2011 08:57:28 Wolfgang Denk wrote:
> Michal Simek wrote:
> > >>      defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
> > >>      defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
> > >>      defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
> > >> -    defined(CONFIG_TEGRA2)
> > >> +    defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE)
> > > 
> > > Am I the only one that thinks this is all really ugly?
> > 
> > I hope you mean serial.h not mb code.
> > 
> > I agree with you but not sure if we can remove all ifdefs there.
> 
> The long list of device specific ifdef's should be converted into a
> single ifdef testing for a specific feature instead.

it's driver specific code in this file, so it doesn't make much sense to have 
the board config define something just to get these prototypes

i do agree that this multi serial code is all very ugly ...
-mike
Wolfgang Denk Oct. 10, 2011, 5:35 p.m. UTC | #5
Dear Mike Frysinger,

In message <201110101118.05350.vapier@gentoo.org> you wrote:
>
> > > >>      defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
> > > >>      defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
> > > >>      defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
> > > >> -    defined(CONFIG_TEGRA2)
> > > >> +    defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE)
> > > > 
> > > > Am I the only one that thinks this is all really ugly?
> > > 
> > > I hope you mean serial.h not mb code.
> > > 
> > > I agree with you but not sure if we can remove all ifdefs there.
> > 
> > The long list of device specific ifdef's should be converted into a
> > single ifdef testing for a specific feature instead.
> 
> it's driver specific code in this file, so it doesn't make much sense to have 
> the board config define something just to get these prototypes

It could be a CPU specific header file, then.

Best regards,

Wolfgang Denk
Mike Frysinger Oct. 10, 2011, 5:52 p.m. UTC | #6
On Monday 10 October 2011 13:35:13 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > > >>      defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
> > > > >>      defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
> > > > >>      defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
> > > > >> 
> > > > >> -    defined(CONFIG_TEGRA2)
> > > > >> +    defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE)
> > > > > 
> > > > > Am I the only one that thinks this is all really ugly?
> > > > 
> > > > I hope you mean serial.h not mb code.
> > > > 
> > > > I agree with you but not sure if we can remove all ifdefs there.
> > > 
> > > The long list of device specific ifdef's should be converted into a
> > > single ifdef testing for a specific feature instead.
> > 
> > it's driver specific code in this file, so it doesn't make much sense to
> > have the board config define something just to get these prototypes
> 
> It could be a CPU specific header file, then.

some of these drivers are shared across SoCs/arches :)
-mike
Wolfgang Denk Oct. 10, 2011, 6:26 p.m. UTC | #7
Dear Mike Frysinger,

In message <201110101352.15660.vapier@gentoo.org> you wrote:
>
> > > it's driver specific code in this file, so it doesn't make much sense to
> > > have the board config define something just to get these prototypes
> > 
> > It could be a CPU specific header file, then.
> 
> some of these drivers are shared across SoCs/arches :)

So put the #define in the CPU specific header files for all
SoCs/arches that use this driver :-)

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index ca5882d..64089c8 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -32,6 +32,7 @@ 
 #include <stdio_dev.h>
 #include <net.h>
 #include <asm/processor.h>
+#include <serial.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -110,6 +111,9 @@  void board_init (void)
 
 	monitor_flash_len = __end - __text_start;
 
+#ifdef CONFIG_SERIAL_MULTI
+	serial_initialize();
+#endif
 	/*
 	 * The Malloc area is immediately below the monitor copy in DRAM
 	 * aka CONFIG_SYS_MONITOR_BASE - Note there is no need for reloc_off
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h
index 6b3fd76..89657189 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -31,6 +31,8 @@ 
 #define	CONFIG_MICROBLAZE	1
 #define	MICROBLAZE_V5		1
 
+#define CONFIG_SERIAL_MULTI 1
+
 /* uart */
 #ifdef XILINX_UARTLITE_BASEADDR
 # define CONFIG_XILINX_UARTLITE
diff --git a/include/serial.h b/include/serial.h
index 5926244..f047d2f 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -31,7 +31,7 @@  extern struct serial_device * default_serial_console (void);
     defined(CONFIG_MB86R0x) || defined(CONFIG_MPC5xxx) || \
     defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) || \
     defined(CONFIG_MPC86xx) || defined(CONFIG_SYS_SC520) || \
-    defined(CONFIG_TEGRA2)
+    defined(CONFIG_TEGRA2) || defined(CONFIG_MICROBLAZE)
 extern struct serial_device serial0_device;
 extern struct serial_device serial1_device;
 #if defined(CONFIG_SYS_NS16550_SERIAL)