diff options
author | Jon Loeliger <jdl@freescale.com> | 2008-06-06 10:48:31 -0500 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2008-06-06 10:48:31 -0500 |
commit | 1a247ba7fa5fb09f56892a09a990f03ce564b3e2 (patch) | |
tree | 9dab0ef013cc6dc7883454808ecf6ba4d7a7a94e /board/gen860t | |
parent | 2c289e320dcfb3760e99cf1d765cb067194a1202 (diff) | |
parent | 8155efbd7ae9c65564ca98affe94631d612ae088 (diff) | |
download | u-boot-imx-1a247ba7fa5fb09f56892a09a990f03ce564b3e2.zip u-boot-imx-1a247ba7fa5fb09f56892a09a990f03ce564b3e2.tar.gz u-boot-imx-1a247ba7fa5fb09f56892a09a990f03ce564b3e2.tar.bz2 |
Merge commit 'wd/master'
Diffstat (limited to 'board/gen860t')
-rw-r--r-- | board/gen860t/README | 2 | ||||
-rw-r--r-- | board/gen860t/beeper.c | 104 | ||||
-rw-r--r-- | board/gen860t/beeper.h | 2 | ||||
-rw-r--r-- | board/gen860t/flash.c | 22 | ||||
-rw-r--r-- | board/gen860t/fpga.c | 2 | ||||
-rw-r--r-- | board/gen860t/fpga.h | 2 | ||||
-rw-r--r-- | board/gen860t/ioport.c | 16 | ||||
-rw-r--r-- | board/gen860t/ioport.h | 2 | ||||
-rw-r--r-- | board/gen860t/u-boot-flashenv.lds | 8 | ||||
-rw-r--r-- | board/gen860t/u-boot.lds | 8 |
10 files changed, 72 insertions, 96 deletions
diff --git a/board/gen860t/README b/board/gen860t/README index 7205afb..e20680d 100644 --- a/board/gen860t/README +++ b/board/gen860t/README @@ -142,5 +142,3 @@ Sr. Staff Engineer Microvision, Inc. <keith_outwater@mvis.com> <outwater@eskimo.com> - -vim: set ts=4 sw=4 tw=78: diff --git a/board/gen860t/beeper.c b/board/gen860t/beeper.c index 46fe66b..b4c2c89 100644 --- a/board/gen860t/beeper.c +++ b/board/gen860t/beeper.c @@ -34,7 +34,6 @@ * drives the amplifier input. */ - /* * Initialize beeper-related hardware. Initialize timer 1 for use with * the beeper. Use 66 Mhz internal clock with prescale of 33 to get @@ -42,66 +41,59 @@ * FIXME: we should really compute the prescale based on the reported * core clock frequency. */ -void -init_beeper(void) +void init_beeper (void) { - volatile immap_t *immap = (immap_t *)CFG_IMMR; + volatile immap_t *immap = (immap_t *) CFG_IMMR; immap->im_cpmtimer.cpmt_tgcr &= ~TGCR_RST1 | TGCR_STP1; immap->im_cpmtimer.cpmt_tmr1 = ((33 << TMR_PS_SHIFT) & TMR_PS_MSK) - | TMR_OM | TMR_FRR | TMR_ICLK_IN_GEN; + | TMR_OM | TMR_FRR | TMR_ICLK_IN_GEN; immap->im_cpmtimer.cpmt_tcn1 = 0; immap->im_cpmtimer.cpmt_ter1 = 0xffff; immap->im_cpmtimer.cpmt_tgcr |= TGCR_RST1; } - /* * Set beeper frequency. Max allowed frequency is 2.5 KHz. This limit * is mostly arbitrary, but the beeper isn't really much good beyond this * frequency. */ -void -set_beeper_frequency(uint frequency) +void set_beeper_frequency (uint frequency) { #define FREQ_LIMIT 2500 - volatile immap_t *immap = (immap_t *)CFG_IMMR; + volatile immap_t *immap = (immap_t *) CFG_IMMR; /* * Compute timer ticks given desired frequency. The timer is set up * to count 0.5 uS per tick and it takes two ticks per cycle (Hz). */ - if (frequency > FREQ_LIMIT) frequency = FREQ_LIMIT; - frequency = 1000000/frequency; - immap->im_cpmtimer.cpmt_trr1 = (ushort)frequency; + if (frequency > FREQ_LIMIT) + frequency = FREQ_LIMIT; + frequency = 1000000 / frequency; + immap->im_cpmtimer.cpmt_trr1 = (ushort) frequency; } - /* * Turn the beeper on */ -void -beeper_on(void) +void beeper_on (void) { - volatile immap_t *immap = (immap_t *)CFG_IMMR; + volatile immap_t *immap = (immap_t *) CFG_IMMR; immap->im_cpmtimer.cpmt_tgcr &= ~TGCR_STP1; } - /* * Turn the beeper off */ -void -beeper_off(void) +void beeper_off (void) { - volatile immap_t *immap = (immap_t *)CFG_IMMR; + volatile immap_t *immap = (immap_t *) CFG_IMMR; immap->im_cpmtimer.cpmt_tgcr |= TGCR_STP1; } - /* * Increase or decrease the beeper volume. Volume can be set * from off to full in 64 steps. To increase volume, the output @@ -110,75 +102,71 @@ beeper_off(void) * change pin mode to tristate) then output a high to go back to * tristate. */ -void -set_beeper_volume(int steps) +void set_beeper_volume (int steps) { - volatile immap_t *immap = (immap_t *)CFG_IMMR; + volatile immap_t *immap = (immap_t *) CFG_IMMR; int i; if (steps >= 0) { for (i = 0; i < (steps >= 64 ? 64 : steps); i++) { immap->im_cpm.cp_pbodr &= ~(0x80000000 >> 19); - udelay(1); + udelay (1); immap->im_cpm.cp_pbodr |= (0x80000000 >> 19); - udelay(1); + udelay (1); } - } - else { + } else { for (i = 0; i > (steps <= -64 ? -64 : steps); i--) { immap->im_cpm.cp_pbdat &= ~(0x80000000 >> 19); - udelay(1); + udelay (1); immap->im_cpm.cp_pbdat |= (0x80000000 >> 19); - udelay(1); + udelay (1); } } } - /* * Check the environment to see if the beeper needs beeping. * Controlled by a sequence of the form: * freq/delta volume/on time/off time;... where: - * freq = frequency in Hz (0 - 2500) + * freq = frequency in Hz (0 - 2500) * delta volume = volume steps up or down (-64 <= vol <= 64) * on time = time in mS * off time = time in mS * * Return 1 on success, 0 on failure */ -int -do_beeper(char *sequence) +int do_beeper (char *sequence) { #define DELIMITER ';' -int args[4]; -int i; -int val; -char *p = sequence; -char *tp; + int args[4]; + int i; + int val; + char *p = sequence; + char *tp; /* * Parse the control sequence. This is a really simple parser * without any real error checking. You can probably blow it * up really easily. */ - if (*p == '\0' || !isdigit(*p)) { - printf("%s:%d: null or invalid string (%s)\n", - __FILE__, __LINE__, p); + if (*p == '\0' || !isdigit (*p)) { + printf ("%s:%d: null or invalid string (%s)\n", + __FILE__, __LINE__, p); return 0; } i = 0; while (*p != '\0') { while (*p != DELIMITER) { - if (i > 3) i = 0; - val = (int) simple_strtol(p, &tp, 0); + if (i > 3) + i = 0; + val = (int) simple_strtol (p, &tp, 0); if (tp == p) { - printf("%s:%d: no digits or bad format\n", - __FILE__,__LINE__); + printf ("%s:%d: no digits or bad format\n", + __FILE__, __LINE__); return 0; - } - else { + } else { args[i] = val; } @@ -195,19 +183,17 @@ char *tp; */ #if 0 for (i = 0; i < 4; i++) { - printf("%s:%d:arg %d = %d\n", __FILE__, __LINE__, i, args[i]); + printf ("%s:%d:arg %d = %d\n", __FILE__, __LINE__, i, + args[i]); } - printf("\n"); + printf ("\n"); #endif - - set_beeper_frequency(args[0]); - set_beeper_volume(args[1]); - beeper_on(); - udelay(1000 * args[2]); - beeper_off(); - udelay(1000 * args[3]); + set_beeper_frequency (args[0]); + set_beeper_volume (args[1]); + beeper_on (); + udelay (1000 * args[2]); + beeper_off (); + udelay (1000 * args[3]); } return 1; } - -/* vim: set ts=4 sw=4 tw=78: */ diff --git a/board/gen860t/beeper.h b/board/gen860t/beeper.h index 535ee6c..125b90f 100644 --- a/board/gen860t/beeper.h +++ b/board/gen860t/beeper.h @@ -27,5 +27,3 @@ void beeper_on(void); void beeper_off(void); void set_beeper_volume(int steps); int do_beeper(char *sequence); - -/* vim: set ts=4 tw=78 sw=4: */ diff --git a/board/gen860t/flash.c b/board/gen860t/flash.c index ec32d07..13faaf3 100644 --- a/board/gen860t/flash.c +++ b/board/gen860t/flash.c @@ -156,9 +156,9 @@ flash_init (void) * Monitor protection is ON by default */ flash_protect(FLAG_PROTECT_SET, - CFG_MONITOR_BASE, - CFG_MONITOR_BASE + monitor_flash_len - 1, - &flash_info[0]); + CFG_MONITOR_BASE, + CFG_MONITOR_BASE + monitor_flash_len - 1, + &flash_info[0]); #endif #ifdef CFG_ENV_IS_IN_FLASH @@ -166,9 +166,9 @@ flash_init (void) * Environment protection ON by default */ flash_protect(FLAG_PROTECT_SET, - CFG_ENV_ADDR, - CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1, - &flash_info[0]); + CFG_ENV_ADDR, + CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1, + &flash_info[0]); #endif PRINTF("## Final Flash bank size: 0x%08lx\n",size_b0); @@ -190,14 +190,14 @@ flash_get_offsets (ulong base, flash_info_t *info) switch (info->flash_id & FLASH_VENDMASK) { case FLASH_MAN_INTEL: - for (i = 0; i < info->sector_count; i++) { + for (i = 0; i < info->sector_count; i++) { info->start[i] = base; base += 1024 * 128; - } - return; + } + return; default: - printf ("Don't know sector offsets for FLASH" + printf ("Don't know sector offsets for FLASH" " type 0x%lx\n", info->flash_id); return; } @@ -436,7 +436,7 @@ write_flash_buffer8(flash_info_t *info_p, vu_char *src_p, vu_char *dest_p, * We assume that the block does not cross a boundary (we'll check before * calling this function). */ - for (i = 0; i < info_p->sector_count; ++i) { + for (i = 0; i < info_p->sector_count; ++i) { if ( ((ulong)dest_p >= info_p->start[i]) && ((ulong)dest_p < (info_p->start[i] + blocksize)) ) { PRINTF("%s:%d: Dest addr 0x%p is in block %d @ 0x%.8lx\n", diff --git a/board/gen860t/fpga.c b/board/gen860t/fpga.c index 3816e52..1e6bdf1 100644 --- a/board/gen860t/fpga.c +++ b/board/gen860t/fpga.c @@ -376,5 +376,3 @@ int fpga_busy_fn (int cookie) return 0; } #endif - -/* vim: set ts=4 tw=78 sw=4: */ diff --git a/board/gen860t/fpga.h b/board/gen860t/fpga.h index 01967a4..18deb73 100644 --- a/board/gen860t/fpga.h +++ b/board/gen860t/fpga.h @@ -41,5 +41,3 @@ extern int fpga_busy_fn(int cookie); extern int fpga_abort_fn(int cookie ); extern int fpga_pre_config_fn(int cookie ); extern int fpga_post_config_fn(int cookie ); - -/* vim: set ts=4 sw=4 tw=78: */ diff --git a/board/gen860t/ioport.c b/board/gen860t/ioport.c index 1fc9545..d8c3006 100644 --- a/board/gen860t/ioport.c +++ b/board/gen860t/ioport.c @@ -43,10 +43,10 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = { /* * Port A configuration * Pin Signal Type Active Initial state - * PA7 fpgaProgramLowOut Out Low High - * PA1 fpgaCoreVoltageFailLow In Low N/A + * PA7 fpgaProgramLowOut Out Low High + * PA1 fpgaCoreVoltageFailLow In Low N/A */ - { /* conf ppar psor pdir podr pdat pint function */ + { /* conf ppar psor pdir podr pdat pint function */ /* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* No pin */ /* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* No pin */ /* PA15 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */ @@ -83,7 +83,7 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = { * PB23 batteryOkSig In High X * PB31 pulseCatcherClr Out High 0 */ - { /* conf ppar psor pdir podr pdat pint function */ + { /* conf ppar psor pdir podr pdat pint function */ #if !defined(CONFIG_SC) /* PB31 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */ #else @@ -116,7 +116,7 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = { #if !defined(CONFIG_SC) /* PB14 */ { 1, 0, 0, 0, 0, 0, 0 } /* docBusyLow */ #else - /* PB14 */ { 0, 0, 0, 0, 0, 0, 0 } /* */ + /* PB14 */ { 0, 0, 0, 0, 0, 0, 0 } /* */ #endif }, @@ -132,7 +132,7 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = { * PC12 systemBitOkIn In High X * PC15 selfDreqLow In Low X */ - { /* conf ppar psor pdir podr pdat pint function */ + { /* conf ppar psor pdir podr pdat pint function */ /* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */ /* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */ /* PC15 */ { 1, 0, 0, 0, 0, 0, 0 }, /* selfDreqLowIn */ @@ -141,7 +141,7 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = { #if !defined(CONFIG_SC) /* PC12 */ { 1, 0, 0, 0, 0, 0, 0 }, /* systemBitOkIn */ #else - /* PC12 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */ + /* PC12 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */ #endif /* PC11 */ { 1, 0, 0, 1, 0, 1, 0 }, /* fpgaResetLowOut */ #if !defined(CONFIG_SC) @@ -173,7 +173,7 @@ const mpc8xx_iop_conf_t iop_conf_tab[NUM_PORTS][PORT_BITS] = { /* * Port D configuration */ - { /* conf ppar psor pdir podr pdat pint function */ + { /* conf ppar psor pdir podr pdat pint function */ /* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */ /* N/A */ { 0, 0, 0, 0, 0, 0, 0 }, /* */ /* PD15 */ { 0, 0, 0, 0, 0, 0, 0 }, /* */ diff --git a/board/gen860t/ioport.h b/board/gen860t/ioport.h index 34a2d7b..3af0bc9 100644 --- a/board/gen860t/ioport.h +++ b/board/gen860t/ioport.h @@ -40,5 +40,3 @@ typedef struct { } mpc8xx_iop_conf_t; extern void config_mpc8xx_ioports(volatile immap_t *immr); - -/* vim: set ts=4 tw=78 sw=4: */ diff --git a/board/gen860t/u-boot-flashenv.lds b/board/gen860t/u-boot-flashenv.lds index aa124f9..bb03d3a 100644 --- a/board/gen860t/u-boot-flashenv.lds +++ b/board/gen860t/u-boot-flashenv.lds @@ -36,11 +36,11 @@ SECTIONS .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } .rel.text : { *(.rel.text) } - .rela.text : { *(.rela.text) } + .rela.text : { *(.rela.text) } .rel.data : { *(.rel.data) } - .rela.data : { *(.rela.data) } - .rel.rodata : { *(.rel.rodata) } - .rela.rodata : { *(.rela.rodata) } + .rela.data : { *(.rela.data) } + .rel.rodata : { *(.rel.rodata) } + .rela.rodata : { *(.rela.rodata) } .rel.got : { *(.rel.got) } .rela.got : { *(.rela.got) } .rel.ctors : { *(.rel.ctors) } diff --git a/board/gen860t/u-boot.lds b/board/gen860t/u-boot.lds index ce1ffe0..d33aa2e 100644 --- a/board/gen860t/u-boot.lds +++ b/board/gen860t/u-boot.lds @@ -35,11 +35,11 @@ SECTIONS .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } .rel.text : { *(.rel.text) } - .rela.text : { *(.rela.text) } + .rela.text : { *(.rela.text) } .rel.data : { *(.rel.data) } - .rela.data : { *(.rela.data) } - .rel.rodata : { *(.rel.rodata) } - .rela.rodata : { *(.rela.rodata) } + .rela.data : { *(.rela.data) } + .rel.rodata : { *(.rel.rodata) } + .rela.rodata : { *(.rela.rodata) } .rel.got : { *(.rel.got) } .rela.got : { *(.rela.got) } .rel.ctors : { *(.rel.ctors) } |