diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2009-02-04 03:49:45 -0500 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2009-02-04 03:49:45 -0500 |
commit | b52dae3139066765a7d96563e9cd33d9e60efe33 (patch) | |
tree | da26ba9d26fc0c89bd19261815cf7dfa09499152 /arch/blackfin | |
parent | 5b93e13ffa8b06ff80eaa8e0ae92e44ebf61cde9 (diff) |
Blackfin arch: Fix bug - Run "reboot" hangs bf518-ezbrd
[Mike Frysinger <vapier.adi@gmail.com>:
- setup P_DEFAULT_BOOT_SPI_CS for every arch based on
the default bootrom behavior and convert all our boards
to it
- revert previous anomaly change ... bf51x is not affected
by anomaly 05000353]
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/include/asm/reboot.h | 2 | ||||
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 5 | ||||
-rw-r--r-- | arch/blackfin/mach-bf518/boards/ezbrd.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf518/include/mach/portmux.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/boards/cm_bf527.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezbrd.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/boards/ezkit.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf527/include/mach/portmux.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/include/mach/portmux.h | 5 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/generic_board.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/minotaur.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-bf537/include/mach/portmux.h | 1 | ||||
-rw-r--r-- | arch/blackfin/mach-bf538/include/mach/portmux.h | 1 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/include/mach/portmux.h | 1 | ||||
-rw-r--r-- | arch/blackfin/mach-bf561/include/mach/portmux.h | 1 |
16 files changed, 19 insertions, 15 deletions
diff --git a/arch/blackfin/include/asm/reboot.h b/arch/blackfin/include/asm/reboot.h index 4856d62b7467..ae1e36329bec 100644 --- a/arch/blackfin/include/asm/reboot.h +++ b/arch/blackfin/include/asm/reboot.h | |||
@@ -15,6 +15,6 @@ extern void native_machine_halt(void); | |||
15 | extern void native_machine_power_off(void); | 15 | extern void native_machine_power_off(void); |
16 | 16 | ||
17 | /* common reboot workarounds */ | 17 | /* common reboot workarounds */ |
18 | extern void bfin_gpio_reset_spi0_ssel1(void); | 18 | extern void bfin_reset_boot_spi_cs(unsigned short pin); |
19 | 19 | ||
20 | #endif | 20 | #endif |
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index 7f69f43be987..44b6c9da6c35 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c | |||
@@ -1172,10 +1172,9 @@ EXPORT_SYMBOL(bfin_gpio_get_value); | |||
1172 | * lives here as we need to force all the GPIO states w/out going through | 1172 | * lives here as we need to force all the GPIO states w/out going through |
1173 | * BUG() checks and such. | 1173 | * BUG() checks and such. |
1174 | */ | 1174 | */ |
1175 | void bfin_gpio_reset_spi0_ssel1(void) | 1175 | void bfin_reset_boot_spi_cs(unsigned short pin) |
1176 | { | 1176 | { |
1177 | u16 gpio = P_IDENT(P_SPI0_SSEL1); | 1177 | unsigned short gpio = P_IDENT(pin); |
1178 | |||
1179 | port_setup(gpio, GPIO_USAGE); | 1178 | port_setup(gpio, GPIO_USAGE); |
1180 | gpio_array[gpio_bank(gpio)]->data_set = gpio_bit(gpio); | 1179 | gpio_array[gpio_bank(gpio)]->data_set = gpio_bit(gpio); |
1181 | AWA_DUMMY_READ(data_set); | 1180 | AWA_DUMMY_READ(data_set); |
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c index 15f1351c8645..ee003f47a824 100644 --- a/arch/blackfin/mach-bf518/boards/ezbrd.c +++ b/arch/blackfin/mach-bf518/boards/ezbrd.c | |||
@@ -649,7 +649,7 @@ void native_machine_restart(char *cmd) | |||
649 | { | 649 | { |
650 | /* workaround reboot hang when booting from SPI */ | 650 | /* workaround reboot hang when booting from SPI */ |
651 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | 651 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
652 | bfin_gpio_reset_spi0_ssel1(); | 652 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
653 | } | 653 | } |
654 | 654 | ||
655 | void bfin_get_ether_addr(char *addr) | 655 | void bfin_get_ether_addr(char *addr) |
diff --git a/arch/blackfin/mach-bf518/include/mach/portmux.h b/arch/blackfin/mach-bf518/include/mach/portmux.h index ac16d54734d4..f618b487b2b0 100644 --- a/arch/blackfin/mach-bf518/include/mach/portmux.h +++ b/arch/blackfin/mach-bf518/include/mach/portmux.h | |||
@@ -103,6 +103,8 @@ | |||
103 | #define P_SPI1_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(2)) | 103 | #define P_SPI1_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(2)) |
104 | #define P_SPI1_SSEL5 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(2)) | 104 | #define P_SPI1_SSEL5 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(2)) |
105 | 105 | ||
106 | #define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL2 | ||
107 | |||
106 | /* SPORT Port Mux */ | 108 | /* SPORT Port Mux */ |
107 | #define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0)) | 109 | #define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0)) |
108 | #define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0)) | 110 | #define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0)) |
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c index a2c3578f4b6c..0281159b1c9b 100644 --- a/arch/blackfin/mach-bf527/boards/cm_bf527.c +++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c | |||
@@ -988,7 +988,7 @@ void native_machine_restart(char *cmd) | |||
988 | { | 988 | { |
989 | /* workaround reboot hang when booting from SPI */ | 989 | /* workaround reboot hang when booting from SPI */ |
990 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | 990 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
991 | bfin_gpio_reset_spi0_ssel1(); | 991 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
992 | } | 992 | } |
993 | 993 | ||
994 | void bfin_get_ether_addr(char *addr) | 994 | void bfin_get_ether_addr(char *addr) |
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c index 0314bd3355eb..521b25363815 100644 --- a/arch/blackfin/mach-bf527/boards/ezbrd.c +++ b/arch/blackfin/mach-bf527/boards/ezbrd.c | |||
@@ -784,7 +784,7 @@ void native_machine_restart(char *cmd) | |||
784 | { | 784 | { |
785 | /* workaround reboot hang when booting from SPI */ | 785 | /* workaround reboot hang when booting from SPI */ |
786 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | 786 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
787 | bfin_gpio_reset_spi0_ssel1(); | 787 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
788 | } | 788 | } |
789 | 789 | ||
790 | void bfin_get_ether_addr(char *addr) | 790 | void bfin_get_ether_addr(char *addr) |
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c index 9454fb7b18c3..60fd9743ebc1 100644 --- a/arch/blackfin/mach-bf527/boards/ezkit.c +++ b/arch/blackfin/mach-bf527/boards/ezkit.c | |||
@@ -1068,7 +1068,7 @@ void native_machine_restart(char *cmd) | |||
1068 | { | 1068 | { |
1069 | /* workaround reboot hang when booting from SPI */ | 1069 | /* workaround reboot hang when booting from SPI */ |
1070 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | 1070 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
1071 | bfin_gpio_reset_spi0_ssel1(); | 1071 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
1072 | } | 1072 | } |
1073 | 1073 | ||
1074 | void bfin_get_ether_addr(char *addr) | 1074 | void bfin_get_ether_addr(char *addr) |
diff --git a/arch/blackfin/mach-bf527/include/mach/portmux.h b/arch/blackfin/mach-bf527/include/mach/portmux.h index 7f6da2c386bb..72b1652be4da 100644 --- a/arch/blackfin/mach-bf527/include/mach/portmux.h +++ b/arch/blackfin/mach-bf527/include/mach/portmux.h | |||
@@ -73,6 +73,8 @@ | |||
73 | 73 | ||
74 | #define P_HWAIT (P_DONTCARE) | 74 | #define P_HWAIT (P_DONTCARE) |
75 | 75 | ||
76 | #define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL1 | ||
77 | |||
76 | #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0)) | 78 | #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0)) |
77 | #define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(2)) | 79 | #define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(2)) |
78 | #define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(2)) | 80 | #define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(2)) |
diff --git a/arch/blackfin/mach-bf533/include/mach/portmux.h b/arch/blackfin/mach-bf533/include/mach/portmux.h index 685a2651dcda..2f59ce0b0cb5 100644 --- a/arch/blackfin/mach-bf533/include/mach/portmux.h +++ b/arch/blackfin/mach-bf533/include/mach/portmux.h | |||
@@ -54,14 +54,11 @@ | |||
54 | #define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2)) | 54 | #define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2)) |
55 | #define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1)) | 55 | #define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1)) |
56 | #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0)) | 56 | #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0)) |
57 | #define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL2 | ||
57 | 58 | ||
58 | #define P_TMR2 (P_DONTCARE) | 59 | #define P_TMR2 (P_DONTCARE) |
59 | #define P_TMR1 (P_DONTCARE) | 60 | #define P_TMR1 (P_DONTCARE) |
60 | #define P_TMR0 (P_DONTCARE) | 61 | #define P_TMR0 (P_DONTCARE) |
61 | #define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF1)) | 62 | #define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF1)) |
62 | 63 | ||
63 | |||
64 | |||
65 | |||
66 | |||
67 | #endif /* _MACH_PORTMUX_H_ */ | 64 | #endif /* _MACH_PORTMUX_H_ */ |
diff --git a/arch/blackfin/mach-bf537/boards/generic_board.c b/arch/blackfin/mach-bf537/boards/generic_board.c index dd6e6bfb98ea..d12ddf155102 100644 --- a/arch/blackfin/mach-bf537/boards/generic_board.c +++ b/arch/blackfin/mach-bf537/boards/generic_board.c | |||
@@ -726,7 +726,7 @@ void native_machine_restart(char *cmd) | |||
726 | { | 726 | { |
727 | /* workaround reboot hang when booting from SPI */ | 727 | /* workaround reboot hang when booting from SPI */ |
728 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | 728 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
729 | bfin_gpio_reset_spi0_ssel1(); | 729 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
730 | } | 730 | } |
731 | 731 | ||
732 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) | 732 | #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE) |
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c index bb795341cb17..8f36d260aee2 100644 --- a/arch/blackfin/mach-bf537/boards/minotaur.c +++ b/arch/blackfin/mach-bf537/boards/minotaur.c | |||
@@ -377,5 +377,5 @@ void native_machine_restart(char *cmd) | |||
377 | { | 377 | { |
378 | /* workaround reboot hang when booting from SPI */ | 378 | /* workaround reboot hang when booting from SPI */ |
379 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | 379 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
380 | bfin_gpio_reset_spi0_ssel1(); | 380 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
381 | } | 381 | } |
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index d812e2514a2f..447d6d40361b 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c | |||
@@ -1307,7 +1307,7 @@ void native_machine_restart(char *cmd) | |||
1307 | { | 1307 | { |
1308 | /* workaround reboot hang when booting from SPI */ | 1308 | /* workaround reboot hang when booting from SPI */ |
1309 | if ((bfin_read_SYSCR() & 0x7) == 0x3) | 1309 | if ((bfin_read_SYSCR() & 0x7) == 0x3) |
1310 | bfin_gpio_reset_spi0_ssel1(); | 1310 | bfin_reset_boot_spi_cs(P_DEFAULT_BOOT_SPI_CS); |
1311 | } | 1311 | } |
1312 | 1312 | ||
1313 | /* | 1313 | /* |
diff --git a/arch/blackfin/mach-bf537/include/mach/portmux.h b/arch/blackfin/mach-bf537/include/mach/portmux.h index 78fee6e0f237..87285e75e903 100644 --- a/arch/blackfin/mach-bf537/include/mach/portmux.h +++ b/arch/blackfin/mach-bf537/include/mach/portmux.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1)) | 31 | #define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1)) |
32 | #define P_TACLK0 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1)) | 32 | #define P_TACLK0 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1)) |
33 | #define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1)) | 33 | #define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1)) |
34 | #define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL1 | ||
34 | 35 | ||
35 | #define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0)) | 36 | #define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0)) |
36 | #define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0)) | 37 | #define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0)) |
diff --git a/arch/blackfin/mach-bf538/include/mach/portmux.h b/arch/blackfin/mach-bf538/include/mach/portmux.h index 1e031b588b47..c8db264e3e4d 100644 --- a/arch/blackfin/mach-bf538/include/mach/portmux.h +++ b/arch/blackfin/mach-bf538/include/mach/portmux.h | |||
@@ -102,5 +102,6 @@ | |||
102 | #define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2)) | 102 | #define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2)) |
103 | #define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1)) | 103 | #define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1)) |
104 | #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0)) | 104 | #define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0)) |
105 | #define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL2 | ||
105 | 106 | ||
106 | #endif /* _MACH_PORTMUX_H_ */ | 107 | #endif /* _MACH_PORTMUX_H_ */ |
diff --git a/arch/blackfin/mach-bf548/include/mach/portmux.h b/arch/blackfin/mach-bf548/include/mach/portmux.h index 8177a567dcdb..ffb1d0a44b4d 100644 --- a/arch/blackfin/mach-bf548/include/mach/portmux.h +++ b/arch/blackfin/mach-bf548/include/mach/portmux.h | |||
@@ -125,6 +125,7 @@ | |||
125 | #define P_KEY_COL2 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(3)) | 125 | #define P_KEY_COL2 (P_DEFINED | P_IDENT(GPIO_PD14) | P_FUNCT(3)) |
126 | #define P_KEY_COL3 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(3)) | 126 | #define P_KEY_COL3 (P_DEFINED | P_IDENT(GPIO_PD15) | P_FUNCT(3)) |
127 | 127 | ||
128 | #define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL1 | ||
128 | #define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PE0) | P_FUNCT(0)) | 129 | #define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PE0) | P_FUNCT(0)) |
129 | #define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PE1) | P_FUNCT(0)) | 130 | #define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PE1) | P_FUNCT(0)) |
130 | #define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PE2) | P_FUNCT(0)) | 131 | #define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PE2) | P_FUNCT(0)) |
diff --git a/arch/blackfin/mach-bf561/include/mach/portmux.h b/arch/blackfin/mach-bf561/include/mach/portmux.h index a6ee8206efb6..2e5ad6347dea 100644 --- a/arch/blackfin/mach-bf561/include/mach/portmux.h +++ b/arch/blackfin/mach-bf561/include/mach/portmux.h | |||
@@ -85,5 +85,6 @@ | |||
85 | #define P_SPI0_MOSI (P_DONTCARE) | 85 | #define P_SPI0_MOSI (P_DONTCARE) |
86 | #define P_SPI0_MISO (P_DONTCARE) | 86 | #define P_SPI0_MISO (P_DONTCARE) |
87 | #define P_SPI0_SCK (P_DONTCARE) | 87 | #define P_SPI0_SCK (P_DONTCARE) |
88 | #define P_DEFAULT_BOOT_SPI_CS P_SPI0_SSEL2 | ||
88 | 89 | ||
89 | #endif /* _MACH_PORTMUX_H_ */ | 90 | #endif /* _MACH_PORTMUX_H_ */ |