summaryrefslogtreecommitdiff
path: root/board/gen860t
diff options
context:
space:
mode:
Diffstat (limited to 'board/gen860t')
-rw-r--r--board/gen860t/README2
-rw-r--r--board/gen860t/beeper.c104
-rw-r--r--board/gen860t/beeper.h2
-rw-r--r--board/gen860t/flash.c22
-rw-r--r--board/gen860t/fpga.c2
-rw-r--r--board/gen860t/fpga.h2
-rw-r--r--board/gen860t/ioport.c16
-rw-r--r--board/gen860t/ioport.h2
-rw-r--r--board/gen860t/u-boot-flashenv.lds8
-rw-r--r--board/gen860t/u-boot.lds8
10 files changed, 72 insertions, 96 deletions
diff --git a/board/gen860t/README b/board/gen860t/README
index 7205afb4dee..e20680db02a 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 46fe66ba619..b4c2c89885b 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 535ee6c4d68..125b90f4b3e 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 ec32d07dbf2..13faaf39f3e 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 3816e52eed7..1e6bdf1ccf6 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 01967a42fde..18deb739bcb 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 1fc95455ae8..d8c3006a6bd 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 34a2d7b1d9d..3af0bc998db 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 aa124f976d8..bb03d3aacd3 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 ce1ffe0ca9e..d33aa2ea197 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) }