Skip to content

Commit

Permalink
Blackfin: add UART/SPORT early platform resources
Browse files Browse the repository at this point in the history
This lets people easily select the UART/SPORT consoles for early printk
while leveraging the pins declared in the boards file.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
Sonic Zhang authored and Mike Frysinger committed Mar 9, 2010
1 parent b635f19 commit c13ce9f
Show file tree
Hide file tree
Showing 22 changed files with 538 additions and 0 deletions.
27 changes: 27 additions & 0 deletions arch/blackfin/mach-bf518/boards/ezbrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,33 @@ static int __init ezbrd_init(void)

arch_initcall(ezbrd_init);

static struct platform_device *ezbrd_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_UART1
&bfin_uart1_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(ezbrd_early_devices,
ARRAY_SIZE(ezbrd_early_devices));
}

void native_machine_restart(char *cmd)
{
/* workaround reboot hang when booting from SPI */
Expand Down
27 changes: 27 additions & 0 deletions arch/blackfin/mach-bf527/boards/cm_bf527.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,33 @@ static int __init cm_init(void)

arch_initcall(cm_init);

static struct platform_device *cmbf527_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_UART1
&bfin_uart1_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(cmbf527_early_devices,
ARRAY_SIZE(cmbf527_early_devices));
}

void native_machine_restart(char *cmd)
{
/* workaround reboot hang when booting from SPI */
Expand Down
27 changes: 27 additions & 0 deletions arch/blackfin/mach-bf527/boards/ezbrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,33 @@ static int __init ezbrd_init(void)

arch_initcall(ezbrd_init);

static struct platform_device *ezbrd_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_UART1
&bfin_uart1_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(ezbrd_early_devices,
ARRAY_SIZE(ezbrd_early_devices));
}

void native_machine_restart(char *cmd)
{
/* workaround reboot hang when booting from SPI */
Expand Down
27 changes: 27 additions & 0 deletions arch/blackfin/mach-bf527/boards/ezkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,33 @@ static int __init ezkit_init(void)

arch_initcall(ezkit_init);

static struct platform_device *ezkit_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_UART1
&bfin_uart1_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(ezkit_early_devices,
ARRAY_SIZE(ezkit_early_devices));
}

void native_machine_restart(char *cmd)
{
/* workaround reboot hang when booting from SPI */
Expand Down
15 changes: 15 additions & 0 deletions arch/blackfin/mach-bf533/boards/H8606.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,3 +455,18 @@ static int __init H8606_init(void)
}

arch_initcall(H8606_init);

static struct platform_device *H8606_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(H8606_early_devices,
ARRAY_SIZE(H8606_early_devices));
}
24 changes: 24 additions & 0 deletions arch/blackfin/mach-bf533/boards/blackstamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,3 +486,27 @@ static int __init blackstamp_init(void)
}

arch_initcall(blackstamp_init);

static struct platform_device *stamp_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(stamp_early_devices,
ARRAY_SIZE(stamp_early_devices));
}
24 changes: 24 additions & 0 deletions arch/blackfin/mach-bf533/boards/cm_bf533.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,3 +580,27 @@ static int __init cm_bf533_init(void)
}

arch_initcall(cm_bf533_init);

static struct platform_device *cm_bf533_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(cm_bf533_early_devices,
ARRAY_SIZE(cm_bf533_early_devices));
}
15 changes: 15 additions & 0 deletions arch/blackfin/mach-bf533/boards/ezkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,3 +531,18 @@ static int __init ezkit_init(void)
}

arch_initcall(ezkit_init);

static struct platform_device *ezkit_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(ezkit_early_devices,
ARRAY_SIZE(ezkit_early_devices));
}
15 changes: 15 additions & 0 deletions arch/blackfin/mach-bf533/boards/ip0x.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,18 @@ static int __init ip0x_init(void)
}

arch_initcall(ip0x_init);

static struct platform_device *ip0x_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(ip0x_early_devices,
ARRAY_SIZE(ip0x_early_devices));
}
24 changes: 24 additions & 0 deletions arch/blackfin/mach-bf533/boards/stamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,30 @@ static int __init stamp_init(void)

arch_initcall(stamp_init);

static struct platform_device *stamp_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(stamp_early_devices,
ARRAY_SIZE(stamp_early_devices));
}

void native_machine_restart(char *cmd)
{
/* workaround pull up on cpld / flash pin not being strong enough */
Expand Down
27 changes: 27 additions & 0 deletions arch/blackfin/mach-bf537/boards/cm_bf537e.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,33 @@ static int __init cm_bf537e_init(void)

arch_initcall(cm_bf537e_init);

static struct platform_device *cm_bf537e_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_UART1
&bfin_uart1_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(cm_bf537e_early_devices,
ARRAY_SIZE(cm_bf537e_early_devices));
}

void bfin_get_ether_addr(char *addr)
{
random_ether_addr(addr);
Expand Down
27 changes: 27 additions & 0 deletions arch/blackfin/mach-bf537/boards/cm_bf537u.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,33 @@ static int __init cm_bf537u_init(void)

arch_initcall(cm_bf537u_init);

static struct platform_device *cm_bf537u_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_UART1
&bfin_uart1_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(cm_bf537u_early_devices,
ARRAY_SIZE(cm_bf537u_early_devices));
}

void bfin_get_ether_addr(char *addr)
{
random_ether_addr(addr);
Expand Down
27 changes: 27 additions & 0 deletions arch/blackfin/mach-bf537/boards/minotaur.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,33 @@ static int __init minotaur_init(void)

arch_initcall(minotaur_init);

static struct platform_device *minotaur_early_devices[] __initdata = {
#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
#ifdef CONFIG_SERIAL_BFIN_UART0
&bfin_uart0_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_UART1
&bfin_uart1_device,
#endif
#endif

#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
&bfin_sport0_uart_device,
#endif
#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
&bfin_sport1_uart_device,
#endif
#endif
};

void __init native_machine_early_platform_add_devices(void)
{
printk(KERN_INFO "register early platform devices\n");
early_platform_add_devices(minotaur_early_devices,
ARRAY_SIZE(minotaur_early_devices));
}

void native_machine_restart(char *cmd)
{
/* workaround reboot hang when booting from SPI */
Expand Down
Loading

0 comments on commit c13ce9f

Please sign in to comment.