aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf537
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2009-09-23 05:37:46 -0400
committerMike Frysinger <vapier@gentoo.org>2010-03-09 00:30:45 -0500
commitc13ce9fd26c3a0e32b3bf0b00929181e66114ed2 (patch)
tree2f7093e48f93dfdea691b057d9a7ded6fddedc07 /arch/blackfin/mach-bf537
parentb635f1912da764c960c044ffd58ba27157aa2c85 (diff)
Blackfin: add UART/SPORT early platform resources
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>
Diffstat (limited to 'arch/blackfin/mach-bf537')
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537e.c27
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537u.c27
-rw-r--r--arch/blackfin/mach-bf537/boards/minotaur.c27
-rw-r--r--arch/blackfin/mach-bf537/boards/pnav10.c18
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c28
-rw-r--r--arch/blackfin/mach-bf537/boards/tcm_bf537.c27
6 files changed, 154 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537e.c b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
index b4837776b274..c54331282baa 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537e.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537e.c
@@ -760,6 +760,33 @@ static int __init cm_bf537e_init(void)
760 760
761arch_initcall(cm_bf537e_init); 761arch_initcall(cm_bf537e_init);
762 762
763static struct platform_device *cm_bf537e_early_devices[] __initdata = {
764#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
765#ifdef CONFIG_SERIAL_BFIN_UART0
766 &bfin_uart0_device,
767#endif
768#ifdef CONFIG_SERIAL_BFIN_UART1
769 &bfin_uart1_device,
770#endif
771#endif
772
773#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
774#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
775 &bfin_sport0_uart_device,
776#endif
777#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
778 &bfin_sport1_uart_device,
779#endif
780#endif
781};
782
783void __init native_machine_early_platform_add_devices(void)
784{
785 printk(KERN_INFO "register early platform devices\n");
786 early_platform_add_devices(cm_bf537e_early_devices,
787 ARRAY_SIZE(cm_bf537e_early_devices));
788}
789
763void bfin_get_ether_addr(char *addr) 790void bfin_get_ether_addr(char *addr)
764{ 791{
765 random_ether_addr(addr); 792 random_ether_addr(addr);
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537u.c b/arch/blackfin/mach-bf537/boards/cm_bf537u.c
index c6802be65fb1..18daacb00b2c 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537u.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537u.c
@@ -725,6 +725,33 @@ static int __init cm_bf537u_init(void)
725 725
726arch_initcall(cm_bf537u_init); 726arch_initcall(cm_bf537u_init);
727 727
728static struct platform_device *cm_bf537u_early_devices[] __initdata = {
729#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
730#ifdef CONFIG_SERIAL_BFIN_UART0
731 &bfin_uart0_device,
732#endif
733#ifdef CONFIG_SERIAL_BFIN_UART1
734 &bfin_uart1_device,
735#endif
736#endif
737
738#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
739#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
740 &bfin_sport0_uart_device,
741#endif
742#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
743 &bfin_sport1_uart_device,
744#endif
745#endif
746};
747
748void __init native_machine_early_platform_add_devices(void)
749{
750 printk(KERN_INFO "register early platform devices\n");
751 early_platform_add_devices(cm_bf537u_early_devices,
752 ARRAY_SIZE(cm_bf537u_early_devices));
753}
754
728void bfin_get_ether_addr(char *addr) 755void bfin_get_ether_addr(char *addr)
729{ 756{
730 random_ether_addr(addr); 757 random_ether_addr(addr);
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c
index 6403964490d9..c489d602c590 100644
--- a/arch/blackfin/mach-bf537/boards/minotaur.c
+++ b/arch/blackfin/mach-bf537/boards/minotaur.c
@@ -516,6 +516,33 @@ static int __init minotaur_init(void)
516 516
517arch_initcall(minotaur_init); 517arch_initcall(minotaur_init);
518 518
519static struct platform_device *minotaur_early_devices[] __initdata = {
520#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
521#ifdef CONFIG_SERIAL_BFIN_UART0
522 &bfin_uart0_device,
523#endif
524#ifdef CONFIG_SERIAL_BFIN_UART1
525 &bfin_uart1_device,
526#endif
527#endif
528
529#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
530#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
531 &bfin_sport0_uart_device,
532#endif
533#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
534 &bfin_sport1_uart_device,
535#endif
536#endif
537};
538
539void __init native_machine_early_platform_add_devices(void)
540{
541 printk(KERN_INFO "register early platform devices\n");
542 early_platform_add_devices(minotaur_early_devices,
543 ARRAY_SIZE(minotaur_early_devices));
544}
545
519void native_machine_restart(char *cmd) 546void native_machine_restart(char *cmd)
520{ 547{
521 /* workaround reboot hang when booting from SPI */ 548 /* workaround reboot hang when booting from SPI */
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c
index 3c36abdf3405..f08533d4aee8 100644
--- a/arch/blackfin/mach-bf537/boards/pnav10.c
+++ b/arch/blackfin/mach-bf537/boards/pnav10.c
@@ -571,6 +571,24 @@ static int __init pnav_init(void)
571 571
572arch_initcall(pnav_init); 572arch_initcall(pnav_init);
573 573
574static struct platform_device *stamp_early_devices[] __initdata = {
575#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
576#ifdef CONFIG_SERIAL_BFIN_UART0
577 &bfin_uart0_device,
578#endif
579#ifdef CONFIG_SERIAL_BFIN_UART1
580 &bfin_uart1_device,
581#endif
582#endif
583};
584
585void __init native_machine_early_platform_add_devices(void)
586{
587 printk(KERN_INFO "register early platform devices\n");
588 early_platform_add_devices(stamp_early_devices,
589 ARRAY_SIZE(stamp_early_devices));
590}
591
574void bfin_get_ether_addr(char *addr) 592void bfin_get_ether_addr(char *addr)
575{ 593{
576 random_ether_addr(addr); 594 random_ether_addr(addr);
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index df4b6b5c08d4..3cb20d7efbdb 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -1969,6 +1969,34 @@ static int __init stamp_init(void)
1969 1969
1970arch_initcall(stamp_init); 1970arch_initcall(stamp_init);
1971 1971
1972
1973static struct platform_device *stamp_early_devices[] __initdata = {
1974#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
1975#ifdef CONFIG_SERIAL_BFIN_UART0
1976 &bfin_uart0_device,
1977#endif
1978#ifdef CONFIG_SERIAL_BFIN_UART1
1979 &bfin_uart1_device,
1980#endif
1981#endif
1982
1983#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
1984#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
1985 &bfin_sport0_uart_device,
1986#endif
1987#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
1988 &bfin_sport1_uart_device,
1989#endif
1990#endif
1991};
1992
1993void __init native_machine_early_platform_add_devices(void)
1994{
1995 printk(KERN_INFO "register early platform devices\n");
1996 early_platform_add_devices(stamp_early_devices,
1997 ARRAY_SIZE(stamp_early_devices));
1998}
1999
1972void native_machine_restart(char *cmd) 2000void native_machine_restart(char *cmd)
1973{ 2001{
1974 /* workaround reboot hang when booting from SPI */ 2002 /* workaround reboot hang when booting from SPI */
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
index 69a2fb804724..59951cdef588 100644
--- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
@@ -727,6 +727,33 @@ static int __init tcm_bf537_init(void)
727 727
728arch_initcall(tcm_bf537_init); 728arch_initcall(tcm_bf537_init);
729 729
730static struct platform_device *cm_bf537_early_devices[] __initdata = {
731#if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK)
732#ifdef CONFIG_SERIAL_BFIN_UART0
733 &bfin_uart0_device,
734#endif
735#ifdef CONFIG_SERIAL_BFIN_UART1
736 &bfin_uart1_device,
737#endif
738#endif
739
740#if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE)
741#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
742 &bfin_sport0_uart_device,
743#endif
744#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
745 &bfin_sport1_uart_device,
746#endif
747#endif
748};
749
750void __init native_machine_early_platform_add_devices(void)
751{
752 printk(KERN_INFO "register early platform devices\n");
753 early_platform_add_devices(cm_bf537_early_devices,
754 ARRAY_SIZE(cm_bf537_early_devices));
755}
756
730void bfin_get_ether_addr(char *addr) 757void bfin_get_ether_addr(char *addr)
731{ 758{
732 random_ether_addr(addr); 759 random_ether_addr(addr);