diff options
author | wdenk <wdenk> | 2003-06-27 21:31:46 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-06-27 21:31:46 +0000 |
commit | 8bde7f776c77b343aca29b8c7b58464d915ac245 (patch) | |
tree | 20f1fd99975215e7c658454a15cdb4ed4694e2d4 /board/eltec/bab7xx/dc_srom.c | |
parent | 993cad9364c6b87ae429d1ed1130d8153f6f027e (diff) | |
download | u-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.zip u-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.gz u-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.bz2 |
* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc.
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
* Patches by Kenneth Johansson, 25 Jun 2003:
- major rework of command structure
(work done mostly by Michal Cendrowski and Joakim Kristiansen)
Diffstat (limited to 'board/eltec/bab7xx/dc_srom.c')
-rw-r--r-- | board/eltec/bab7xx/dc_srom.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/board/eltec/bab7xx/dc_srom.c b/board/eltec/bab7xx/dc_srom.c index ef956e6..a44af6e 100644 --- a/board/eltec/bab7xx/dc_srom.c +++ b/board/eltec/bab7xx/dc_srom.c @@ -118,7 +118,7 @@ static void srom_address(u_int command, u_long addr, u_char offset) a = (char)(offset << 2); for (i=0; i<6; i++, a <<= 1) { - srom_latch(command | ((a < 0) ? DT_IN : 0), addr); + srom_latch(command | ((a < 0) ? DT_IN : 0), addr); } udelay(1); @@ -136,11 +136,11 @@ static short srom_data_rd (u_int command, u_long addr) for (i=0; i<16; i++) { - sendto_srom(command | DT_CLK, addr); - tmp = getfrom_srom(addr); - sendto_srom(command, addr); + sendto_srom(command | DT_CLK, addr); + tmp = getfrom_srom(addr); + sendto_srom(command, addr); - word = (word << 1) | ((tmp >> 3) & 0x01); + word = (word << 1) | ((tmp >> 3) & 0x01); } sendto_srom(command & 0x0000ff00, addr); @@ -160,13 +160,13 @@ static int srom_data_wr (u_int command, u_long addr, short val) for (i=0; i<16; i++) { - tmp = (longVal & 0x8000)>>13; + tmp = (longVal & 0x8000)>>13; - sendto_srom (tmp | command, addr); - sendto_srom (tmp | command | DT_CLK, addr); - sendto_srom (tmp | command, addr); + sendto_srom (tmp | command, addr); + sendto_srom (tmp | command | DT_CLK, addr); + sendto_srom (tmp | command, addr); - longVal = longVal<<1; + longVal = longVal<<1; } sendto_srom(command & 0x0000ff00, addr); @@ -175,15 +175,15 @@ static int srom_data_wr (u_int command, u_long addr, short val) tmp = 100; do { - if ((getfrom_srom(dc_srom_iobase) & 0x8) == 0x8) - break; - udelay(1000); + if ((getfrom_srom(dc_srom_iobase) & 0x8) == 0x8) + break; + udelay(1000); } while (--tmp); if (tmp == 0) { - printf("Write DEC21143 SRom timed out !\n"); - return (-1); + printf("Write DEC21143 SRom timed out !\n"); + return (-1); } return 0; @@ -218,7 +218,7 @@ static void srom_wr_enable (u_long addr) for (i=0; i<6; i++) { - srom_latch (SROM_WR | SROM_SR | DT_IN | DT_CS, addr); + srom_latch (SROM_WR | SROM_SR | DT_IN | DT_CS, addr); } } @@ -256,8 +256,8 @@ int dc_srom_load (u_short *dest) memset (dest, 0, 128); for (offset=0; offset<64; offset++) { - tmp = srom_rd (dc_srom_iobase, offset); - *dest++ = le16_to_cpu(tmp); + tmp = srom_rd (dc_srom_iobase, offset); + *dest++ = le16_to_cpu(tmp); } return (0); @@ -280,9 +280,9 @@ int dc_srom_store (u_short *src) for (offset=0; offset<64; offset++) { - if (srom_wr (dc_srom_iobase, offset, *src) == -1) - return (-1); - src++; + if (srom_wr (dc_srom_iobase, offset, *src) == -1) + return (-1); + src++; } return (0); |