U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
December 2009
- 154 participants
- 356 discussions
The following debug patch shows that gd->cpu is not being relocated to
ddr. Linux may not be able to boot due to "fdt board" crashing if
flash has been erased or changed.
On mpc8572ds:
=> fdt board
fdt board
cpu_numcores gd=3fe6df68 cpu=effed578 n=2
cpu_numcores gd=3fe6df68 cpu=effed578 n=2
cpu_numcores gd=3fe6df68 cpu=effed578 n=2
cpu_numcores gd=3fe6df68 cpu=effed578 n=2
Signed-off-by: Ed Swarthout <Ed.Swarthout(a)freescale.com>
---
cpu/mpc8xxx/cpu.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/cpu/mpc8xxx/cpu.c b/cpu/mpc8xxx/cpu.c
index d191263..268c1b4 100644
--- a/cpu/mpc8xxx/cpu.c
+++ b/cpu/mpc8xxx/cpu.c
@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
-
+#define DEBUG
#include <config.h>
#include <common.h>
#include <command.h>
@@ -98,6 +98,8 @@ struct cpu_type *identify_cpu(u32 ver)
int cpu_numcores() {
struct cpu_type *cpu;
cpu = gd->cpu;
+ debug("cpu_numcores gd=%x cpu=%x n=%x\n",
+ (int)gd, (int)cpu, cpu->num_cores);
return cpu->num_cores;
}
--
1.5.6.5
4
7

[U-Boot] [PATCH ARM 3/3] s3c24x0 code style changes
by kevin.morfitt@fearnside-systems.co.uk 15 Dec '09
by kevin.morfitt@fearnside-systems.co.uk 15 Dec '09
15 Dec '09
Cleans up the s3c24x0 header files by changing the upper case members
of the s3c24x0 register structures to lower case and changing all code
that uses these register structures.
Signed-off-by: Kevin Morfitt <kevin.morfitt(a)fearnside-systems.co.uk>
---
board/trab/trab.c | 83 +++--
board/trab/trab_fkt.c | 1055 ++++++++++++++++++++++++-------------------------
board/trab/tsc2000.c | 234 ++++++-----
board/trab/tsc2000.h | 90 ++---
board/trab/vfd.c | 550 +++++++++++++++-----------
5 files changed, 1038 insertions(+), 974 deletions(-)
diff --git a/board/trab/trab.c b/board/trab/trab.c
index 71fd22c..31f425f 100644
--- a/board/trab/trab.c
+++ b/board/trab/trab.c
@@ -27,6 +27,7 @@
#include <netdev.h>
#include <malloc.h>
#include <asm/arch/s3c24x0_cpu.h>
+#include <asm/io.h>
#include <command.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -77,36 +78,39 @@ int board_init ()
#ifdef CONFIG_TRAB_50MHZ
/* change the clock to be 50 MHz 1:1:1 */
/* MDIV:0x5c PDIV:4 SDIV:2 */
- clk_power->MPLLCON = 0x5c042;
- clk_power->CLKDIVN = 0;
+ writel(0x5c042, &clk_power->mpllcon);
+ writel(0, &clk_power->clkdivn);
#else
/* change the clock to be 133 MHz 1:2:4 */
/* MDIV:0x7d PDIV:4 SDIV:1 */
- clk_power->MPLLCON = 0x7d041;
- clk_power->CLKDIVN = 3;
+ writel(0x7d041, &clk_power->mpllcon);
+ writel(3, &clk_power->clkdivn);
#endif
/* set up the I/O ports */
- gpio->PACON = 0x3ffff;
- gpio->PBCON = 0xaaaaaaaa;
- gpio->PBUP = 0xffff;
+ writel(0x3ffff, &gpio->pacon);
+ writel(0xaaaaaaaa, &gpio->pbcon);
+ writel(0xffff, &gpio->pbup);
/* INPUT nCTS0 nRTS0 TXD[1] TXD[0] RXD[1] RXD[0] */
/* 00, 10, 10, 10, 10, 10, 10 */
- gpio->PFCON = (2<<0) | (2<<2) | (2<<4) | (2<<6) | (2<<8) | (2<<10);
+ writel((2<<0) | (2<<2) | (2<<4) | (2<<6) | (2<<8) | (2<<10),
+ &gpio->pfcon);
#ifdef CONFIG_HWFLOW
/* do not pull up RXD0, RXD1, TXD0, TXD1, CTS0, RTS0 */
- gpio->PFUP = (1<<0) | (1<<1) | (1<<2) | (1<<3) | (1<<4) | (1<<5);
+ writel((1<<0) | (1<<1) | (1<<2) | (1<<3) | (1<<4) | (1<<5),
+ &gpio->pfup);
#else
/* do not pull up RXD0, RXD1, TXD0, TXD1 */
- gpio->PFUP = (1<<0) | (1<<1) | (1<<2) | (1<<3);
+ writel((1<<0) | (1<<1) | (1<<2) | (1<<3),
+ &gpio->pfup);
#endif
- gpio->PGCON = 0x0;
- gpio->PGUP = 0x0;
- gpio->OPENCR= 0x0;
+ writel(0x0, &gpio->pgcon);
+ writel(0x0, &gpio->pgup);
+ writel(0x0, &gpio->opencr);
/* suppress flicker of the VFDs */
- gpio->MISCCR = 0x40;
- gpio->PFCON |= (2<<12);
+ writel(0x40, &gpio->misccr);
+ writel(readl(&gpio->pfcon) | (2 << 12), &gpio->pfcon);
gd->bd->bi_arch_number = MACH_TYPE_TRAB;
@@ -114,8 +118,8 @@ int board_init ()
gd->bd->bi_boot_params = 0x0c000100;
/* Make sure both buzzers are turned off */
- gpio->PDCON |= 0x5400;
- gpio->PDDAT &= ~0xE0;
+ writel(readl(&gpio->pdcon) | 0x5400, &gpio->pdcon);
+ writel(readl(&gpio->pddat) & ~0xE0, &gpio->pddat);
#ifdef CONFIG_VFD
vfd_init_clocks();
@@ -132,7 +136,7 @@ int board_init ()
#ifdef CONFIG_DRIVER_S3C24X0_I2C
/* Configure I/O ports PG5 und PG6 for I2C */
- gpio->PGCON = (gpio->PGCON & 0x003c00) | 0x003c00;
+ writel((readl(&gpio->pgcon) & 0x003c00) | 0x003c00, &gpio->pgcon);
#endif /* CONFIG_DRIVER_S3C24X0_I2C */
return 0;
@@ -337,18 +341,18 @@ static int key_pressed(void)
#ifdef CONFIG_SYS_BRIGHTNESS
-static inline void SET_CS_TOUCH(void)
+static inline void set_cs_touch(void)
{
struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
- gpio->PDDAT &= 0x5FF;
+ writel(readl(&gpio->pddat) & 0x5FF, &gpio->pddat);
}
-static inline void CLR_CS_TOUCH(void)
+static inline void clr_cs_touch(void)
{
struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
- gpio->PDDAT |= 0x200;
+ writel(readl(&gpio->pddat) | 0x200, &gpio->pddat);
}
static void spi_init(void)
@@ -358,20 +362,23 @@ static void spi_init(void)
int i;
/* Configure I/O ports. */
- gpio->PDCON = (gpio->PDCON & 0xF3FFFF) | 0x040000;
- gpio->PGCON = (gpio->PGCON & 0x0F3FFF) | 0x008000;
- gpio->PGCON = (gpio->PGCON & 0x0CFFFF) | 0x020000;
- gpio->PGCON = (gpio->PGCON & 0x03FFFF) | 0x080000;
+ writel((readl(&gpio->pdcon) & 0xF3FFFF) | 0x040000, &gpio->pdcon);
+ writel((readl(&gpio->pgcon) & 0x0F3FFF) | 0x008000, &gpio->pgcon);
+ writel((readl(&gpio->pgcon) & 0x0CFFFF) | 0x020000, &gpio->pgcon);
+ writel((readl(&gpio->pgcon) & 0x03FFFF) | 0x080000, &gpio->pgcon);
- CLR_CS_TOUCH();
+ clr_cs_touch();
- spi->ch[0].SPPRE = 0x1F; /* Baudrate ca. 514kHz */
- spi->ch[0].SPPIN = 0x01; /* SPI-MOSI holds Level after last bit */
- spi->ch[0].SPCON = 0x1A; /* Polling, Prescaler, Master, CPOL=0, CPHA=1 */
+ /* Baudrate ca. 514kHz */
+ writel(0x1F, &spi->ch[0].sppre);
+ /* SPI-MOSI holds Level after last bit */
+ writel(0x01, &spi->ch[0].sppin);
+ /* Polling, Prescaler, Master, CPOL=0, CPHA=1 */
+ writel(0x1A, &spi->ch[0].spcon);
/* Dummy byte ensures clock to be low. */
for (i = 0; i < 10; i++) {
- spi->ch[0].SPTDAT = 0xFF;
+ writel(0xFF, &spi->ch[0].sptdat);
}
wait_transmit_done();
}
@@ -380,7 +387,7 @@ static void wait_transmit_done(void)
{
struct s3c24x0_spi * const spi = s3c24x0_get_base_spi();
- while (!(spi->ch[0].SPSTA & 0x01)); /* wait until transfer is done */
+ while (!(readl(&spi->ch[0].spsta) & 0x01)); /* wait until transfer is done */
}
static void tsc2000_write(unsigned int page, unsigned int reg,
@@ -389,21 +396,21 @@ static void tsc2000_write(unsigned int page, unsigned int reg,
struct s3c24x0_spi * const spi = s3c24x0_get_base_spi();
unsigned int command;
- SET_CS_TOUCH();
+ set_cs_touch();
command = 0x0000;
command |= (page << 11);
command |= (reg << 5);
- spi->ch[0].SPTDAT = (command & 0xFF00) >> 8;
+ writel((command & 0xFF00) >> 8, &spi->ch[0].sptdat);
wait_transmit_done();
- spi->ch[0].SPTDAT = (command & 0x00FF);
+ writel(command & 0x00FF, &spi->ch[0].sptdat);
wait_transmit_done();
- spi->ch[0].SPTDAT = (data & 0xFF00) >> 8;
+ writel((data & 0xFF00) >> 8, &spi->ch[0].sptdat);
wait_transmit_done();
- spi->ch[0].SPTDAT = (data & 0x00FF);
+ writel(data & 0x00FF, &spi->ch[0].sptdat);
wait_transmit_done();
- CLR_CS_TOUCH();
+ clr_cs_touch();
}
static void tsc2000_set_brightness(void)
diff --git a/board/trab/trab_fkt.c b/board/trab/trab_fkt.c
index 2df9a04..ddf8280 100644
--- a/board/trab/trab_fkt.c
+++ b/board/trab/trab_fkt.c
@@ -27,6 +27,7 @@
#include <exports.h>
#include <timestamp.h>
#include <asm/arch/s3c24x0_cpu.h>
+#include <asm/io.h>
#include "tsc2000.h"
#include "rs485.h"
@@ -64,16 +65,15 @@
#define RELOAD3 (1 << 19)
#define PCLK 66000000
-#define BUZZER_FREQ 1000 /* frequency in Hz */
+#define BUZZER_FREQ 1000 /* frequency in Hz */
#define PWM_FREQ 500
-
/* definitions of I2C EEPROM device address */
#define I2C_EEPROM_DEV_ADDR 0x54
/* definition for touch panel calibration points */
-#define CALIB_TL 0 /* calibration point in (T)op (L)eft corner */
-#define CALIB_DR 1 /* calibration point in (D)own (R)ight corner */
+#define CALIB_TL 0 /* calibration point in (T)op (L)eft corner */
+#define CALIB_DR 1 /* calibration point in (D)own (R)ight corner */
/* EEPROM address map */
#define SERIAL_NUMBER 8
@@ -105,57 +105,56 @@
#define ADC_ECFLG 0x8000
/* function test functions */
-int do_dip (void);
-int do_info (void);
-int do_vcc5v (void);
-int do_vcc12v (void);
-int do_buttons (void);
-int do_fill_level (void);
-int do_rotary_switch (void);
-int do_pressure (void);
-int do_v_bat (void);
-int do_vfd_id (void);
-int do_buzzer (char **);
-int do_led (char **);
-int do_full_bridge (char **);
-int do_dac (char **);
-int do_motor_contact (void);
-int do_motor (char **);
-int do_pwm (char **);
-int do_thermo (char **);
-int do_touch (char **);
-int do_rs485 (char **);
-int do_serial_number (char **);
-int do_crc16 (void);
-int do_power_switch (void);
-int do_gain (char **);
-int do_eeprom (char **);
+int do_dip(void);
+int do_info(void);
+int do_vcc5v(void);
+int do_vcc12v(void);
+int do_buttons(void);
+int do_fill_level(void);
+int do_rotary_switch(void);
+int do_pressure(void);
+int do_v_bat(void);
+int do_vfd_id(void);
+int do_buzzer(char **);
+int do_led(char **);
+int do_full_bridge(char **);
+int do_dac(char **);
+int do_motor_contact(void);
+int do_motor(char **);
+int do_pwm(char **);
+int do_thermo(char **);
+int do_touch(char **);
+int do_rs485(char **);
+int do_serial_number(char **);
+int do_crc16(void);
+int do_power_switch(void);
+int do_gain(char **);
+int do_eeprom(char **);
/* helper functions */
-static void adc_init (void);
-static int adc_read (unsigned int channel);
-static void print_identifier (void);
+static void adc_init(void);
+static int adc_read(unsigned int channel);
+static void print_identifier(void);
#ifdef CONFIG_TOUCH_WAIT_PRESSED
-static void touch_wait_pressed (void);
+static void touch_wait_pressed(void);
#else
-static int touch_check_pressed (void);
+static int touch_check_pressed(void);
#endif /* CONFIG_TOUCH_WAIT_PRESSED */
-static void touch_read_x_y (int *x, int *y);
-static int touch_write_clibration_values (int calib_point, int x, int y);
-static int rs485_send_line (const char *data);
-static int rs485_receive_chars (char *data, int timeout);
+static void touch_read_x_y(int *x, int *y);
+static int touch_write_clibration_values(int calib_point, int x, int y);
+static int rs485_send_line(const char *data);
+static int rs485_receive_chars(char *data, int timeout);
static unsigned short updcrc(unsigned short icrc, unsigned char *icp,
unsigned int icnt);
#if defined(CONFIG_CMD_I2C)
-static int trab_eeprom_read (char **argv);
-static int trab_eeprom_write (char **argv);
-int i2c_write_multiple (uchar chip, uint addr, int alen, uchar *buffer,
- int len);
-int i2c_read_multiple ( uchar chip, uint addr, int alen, uchar *buffer,
- int len);
+static int trab_eeprom_read(char **argv);
+static int trab_eeprom_write(char **argv);
+int i2c_write_multiple(uchar chip, uint addr, int alen, uchar * buffer,
+ int len);
+int i2c_read_multiple(uchar chip, uint addr, int alen, uchar * buffer, int len);
#endif
/*
@@ -163,26 +162,26 @@ int i2c_read_multiple ( uchar chip, uint addr, int alen, uchar *buffer,
* test.
*/
-int trab_fkt (int argc, char *argv[])
+int trab_fkt(int argc, char *argv[])
{
int i;
app_startup(argv);
- if (get_version () != XF_VERSION) {
- printf ("Wrong XF_VERSION. Please re-compile with actual "
- "u-boot sources\n");
- printf ("Example expects ABI version %d\n", XF_VERSION);
- printf ("Actual U-Boot ABI version %d\n", (int)get_version());
+ if (get_version() != XF_VERSION) {
+ printf("Wrong XF_VERSION. Please re-compile with actual "
+ "u-boot sources\n");
+ printf("Example expects ABI version %d\n", XF_VERSION);
+ printf("Actual U-Boot ABI version %d\n", (int)get_version());
return 1;
}
- debug ("argc = %d\n", argc);
+ debug("argc = %d\n", argc);
- for (i=0; i<=argc; ++i) {
- debug ("argv[%d] = \"%s\"\n", i, argv[i] ? argv[i] : "<NULL>");
+ for (i = 0; i <= argc; ++i) {
+ debug("argv[%d] = \"%s\"\n", i, argv[i] ? argv[i] : "<NULL>");
}
- adc_init ();
+ adc_init();
switch (argc) {
@@ -191,98 +190,98 @@ int trab_fkt (int argc, char *argv[])
break;
case 2:
- if (strcmp (argv[1], "info") == 0) {
- return (do_info ());
+ if (strcmp(argv[1], "info") == 0) {
+ return (do_info());
}
- if (strcmp (argv[1], "dip") == 0) {
- return (do_dip ());
+ if (strcmp(argv[1], "dip") == 0) {
+ return (do_dip());
}
- if (strcmp (argv[1], "vcc5v") == 0) {
- return (do_vcc5v ());
+ if (strcmp(argv[1], "vcc5v") == 0) {
+ return (do_vcc5v());
}
- if (strcmp (argv[1], "vcc12v") == 0) {
- return (do_vcc12v ());
+ if (strcmp(argv[1], "vcc12v") == 0) {
+ return (do_vcc12v());
}
- if (strcmp (argv[1], "buttons") == 0) {
- return (do_buttons ());
+ if (strcmp(argv[1], "buttons") == 0) {
+ return (do_buttons());
}
- if (strcmp (argv[1], "fill_level") == 0) {
- return (do_fill_level ());
+ if (strcmp(argv[1], "fill_level") == 0) {
+ return (do_fill_level());
}
- if (strcmp (argv[1], "rotary_switch") == 0) {
- return (do_rotary_switch ());
+ if (strcmp(argv[1], "rotary_switch") == 0) {
+ return (do_rotary_switch());
}
- if (strcmp (argv[1], "pressure") == 0) {
- return (do_pressure ());
+ if (strcmp(argv[1], "pressure") == 0) {
+ return (do_pressure());
}
- if (strcmp (argv[1], "v_bat") == 0) {
- return (do_v_bat ());
+ if (strcmp(argv[1], "v_bat") == 0) {
+ return (do_v_bat());
}
- if (strcmp (argv[1], "vfd_id") == 0) {
- return (do_vfd_id ());
+ if (strcmp(argv[1], "vfd_id") == 0) {
+ return (do_vfd_id());
}
- if (strcmp (argv[1], "motor_contact") == 0) {
- return (do_motor_contact ());
+ if (strcmp(argv[1], "motor_contact") == 0) {
+ return (do_motor_contact());
}
- if (strcmp (argv[1], "crc16") == 0) {
- return (do_crc16 ());
+ if (strcmp(argv[1], "crc16") == 0) {
+ return (do_crc16());
}
- if (strcmp (argv[1], "power_switch") == 0) {
- return (do_power_switch ());
+ if (strcmp(argv[1], "power_switch") == 0) {
+ return (do_power_switch());
}
break;
case 3:
- if (strcmp (argv[1], "full_bridge") == 0) {
- return (do_full_bridge (argv));
+ if (strcmp(argv[1], "full_bridge") == 0) {
+ return (do_full_bridge(argv));
}
- if (strcmp (argv[1], "dac") == 0) {
- return (do_dac (argv));
+ if (strcmp(argv[1], "dac") == 0) {
+ return (do_dac(argv));
}
- if (strcmp (argv[1], "motor") == 0) {
- return (do_motor (argv));
+ if (strcmp(argv[1], "motor") == 0) {
+ return (do_motor(argv));
}
- if (strcmp (argv[1], "pwm") == 0) {
- return (do_pwm (argv));
+ if (strcmp(argv[1], "pwm") == 0) {
+ return (do_pwm(argv));
}
- if (strcmp (argv[1], "thermo") == 0) {
- return (do_thermo (argv));
+ if (strcmp(argv[1], "thermo") == 0) {
+ return (do_thermo(argv));
}
- if (strcmp (argv[1], "touch") == 0) {
- return (do_touch (argv));
+ if (strcmp(argv[1], "touch") == 0) {
+ return (do_touch(argv));
}
- if (strcmp (argv[1], "serial_number") == 0) {
- return (do_serial_number (argv));
+ if (strcmp(argv[1], "serial_number") == 0) {
+ return (do_serial_number(argv));
}
- if (strcmp (argv[1], "buzzer") == 0) {
- return (do_buzzer (argv));
+ if (strcmp(argv[1], "buzzer") == 0) {
+ return (do_buzzer(argv));
}
- if (strcmp (argv[1], "gain") == 0) {
- return (do_gain (argv));
+ if (strcmp(argv[1], "gain") == 0) {
+ return (do_gain(argv));
}
break;
case 4:
- if (strcmp (argv[1], "led") == 0) {
- return (do_led (argv));
+ if (strcmp(argv[1], "led") == 0) {
+ return (do_led(argv));
}
- if (strcmp (argv[1], "rs485") == 0) {
- return (do_rs485 (argv));
+ if (strcmp(argv[1], "rs485") == 0) {
+ return (do_rs485(argv));
}
- if (strcmp (argv[1], "serial_number") == 0) {
- return (do_serial_number (argv));
+ if (strcmp(argv[1], "serial_number") == 0) {
+ return (do_serial_number(argv));
}
break;
case 5:
- if (strcmp (argv[1], "eeprom") == 0) {
- return (do_eeprom (argv));
+ if (strcmp(argv[1], "eeprom") == 0) {
+ return (do_eeprom(argv));
}
break;
case 6:
- if (strcmp (argv[1], "eeprom") == 0) {
- return (do_eeprom (argv));
+ if (strcmp(argv[1], "eeprom") == 0) {
+ return (do_eeprom(argv));
}
break;
@@ -290,25 +289,25 @@ int trab_fkt (int argc, char *argv[])
break;
}
- printf ("Usage:\n<command> <parameter1> <parameter2> ...\n");
+ printf("Usage:\n<command> <parameter1> <parameter2> ...\n");
return 1;
}
-void hang (void)
+void hang(void)
{
- puts ("### ERROR ### Please RESET the board ###\n");
- for (;;);
+ puts("### ERROR ### Please RESET the board ###\n");
+ for (;;) ;
}
-int do_info (void)
+int do_info(void)
{
- printf ("Stand-alone application for TRAB board function test\n");
- printf ("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);
+ printf("Stand-alone application for TRAB board function test\n");
+ printf("Built: %s at %s\n", U_BOOT_DATE, U_BOOT_TIME);
return 0;
}
-int do_dip (void)
+int do_dip(void)
{
unsigned int result = 0;
int adc_val;
@@ -327,8 +326,8 @@ int do_dip (void)
for (i = 7; i > 3; i--) {
- if ((adc_val = adc_read (i)) == -1) {
- printf ("Channel %d could not be read\n", i);
+ if ((adc_val = adc_read(i)) == -1) {
+ printf("Channel %d could not be read\n", i);
return 1;
}
@@ -338,11 +337,11 @@ int do_dip (void)
* Set trigger at halve that value.
*/
if (adc_val < 368)
- result |= (1 << (i-4));
+ result |= (1 << (i - 4));
}
/* print result to console */
- print_identifier ();
+ print_identifier();
for (i = 0; i < 4; i++) {
if ((result & (1 << i)) == 0)
printf("0");
@@ -354,15 +353,14 @@ int do_dip (void)
return 0;
}
-
-int do_vcc5v (void)
+int do_vcc5v(void)
{
int result;
/* VCC5V is connected to channel 2 */
- if ((result = adc_read (VCC5V)) == -1) {
- printf ("VCC5V could not be read\n");
+ if ((result = adc_read(VCC5V)) == -1) {
+ printf("VCC5V could not be read\n");
return 1;
}
@@ -371,22 +369,21 @@ int do_vcc5v (void)
* floating point support. VCC5V is connected over an resistor divider:
* VCC5V=ADCval*2,5V/1023*(10K+30K)/10K.
*/
- print_identifier ();
- printf ("%d", (result & 0x3FF)* 10 / 1023);
- printf (".%d", ((result & 0x3FF)* 10 % 1023)* 10 / 1023);
- printf ("%d V\n", (((result & 0x3FF) * 10 % 1023 ) * 10 % 1023)
- * 10 / 1024);
+ print_identifier();
+ printf("%d", (result & 0x3FF) * 10 / 1023);
+ printf(".%d", ((result & 0x3FF) * 10 % 1023) * 10 / 1023);
+ printf("%d V\n", (((result & 0x3FF) * 10 % 1023) * 10 % 1023)
+ * 10 / 1024);
return 0;
}
-
-int do_vcc12v (void)
+int do_vcc12v(void)
{
int result;
- if ((result = adc_read (VCC12V)) == -1) {
- printf ("VCC12V could not be read\n");
+ if ((result = adc_read(VCC12V)) == -1) {
+ printf("VCC12V could not be read\n");
return 1;
}
@@ -395,63 +392,69 @@ int do_vcc12v (void)
* floating point support. VCC5V is connected over an resistor divider:
* VCC12V=ADCval*2,5V/1023*(30K+270K)/30K.
*/
- print_identifier ();
- printf ("%d", (result & 0x3FF)* 25 / 1023);
- printf (".%d V\n", ((result & 0x3FF)* 25 % 1023) * 10 / 1023);
+ print_identifier();
+ printf("%d", (result & 0x3FF) * 25 / 1023);
+ printf(".%d V\n", ((result & 0x3FF) * 25 % 1023) * 10 / 1023);
return 0;
}
-static int adc_read (unsigned int channel)
+static int adc_read(unsigned int channel)
{
- int j = 1000; /* timeout value for wait loop in us */
+ int j = 1000; /* timeout value for wait loop in us */
int result;
struct s3c2400_adc *padc;
padc = s3c2400_get_base_adc();
channel &= 0x7;
- padc->ADCCON &= ~ADC_STDBM; /* select normal mode */
- padc->ADCCON &= ~(0x7 << 3); /* clear the channel bits */
- padc->ADCCON |= ((channel << 3) | ADC_ENABLE_START);
+ /* select normal mode */
+ writel(readl(&padc->adccon) & ~ADC_STDBM, &padc->adccon);
+ /* clear the channel bits */
+ writel(readl(&padc->adccon) & ~(0x7 << 3), &padc->adccon);
+ writel(readl(&padc->adccon) | ((channel << 3) | ADC_ENABLE_START),
+ &padc->adccon);
while (j--) {
- if ((padc->ADCCON & ADC_ENABLE_START) == 0)
+ if ((readl(&padc->adccon) & ADC_ENABLE_START) == 0)
break;
- udelay (1);
+ udelay(1);
}
if (j == 0) {
printf("%s: ADC timeout\n", __FUNCTION__);
- padc->ADCCON |= ADC_STDBM; /* select standby mode */
+ /* select standby mode */
+ writel(readl(&padc->adccon) | ADC_STDBM, &padc->adccon);
return -1;
}
- result = padc->ADCDAT & 0x3FF;
+ result = readl(&padc->adcdat) & 0x3FF;
- padc->ADCCON |= ADC_STDBM; /* select standby mode */
+ /* select standby mode */
+ writel(readl(&padc->adccon) | ADC_STDBM, &padc->adccon);
- debug ("%s: channel %d, result[DIGIT]=%d\n", __FUNCTION__,
- (padc->ADCCON >> 3) & 0x7, result);
+ debug("%s: channel %d, result[DIGIT]=%d\n", __FUNCTION__,
+ (readl(&padc->adccon) >> 3) & 0x7, result);
/*
* Wait for ADC to be ready for next conversion. This delay value was
* estimated, because the datasheet does not specify a value.
*/
- udelay (1000);
+ udelay(1000);
return (result);
}
-
-static void adc_init (void)
+static void adc_init(void)
{
struct s3c2400_adc *padc;
padc = s3c2400_get_base_adc();
- padc->ADCCON &= ~(0xff << 6); /* clear prescaler bits */
- padc->ADCCON |= ((65 << 6) | ADC_PRSCEN); /* set prescaler */
+ /* clear prescaler bits */
+ writel(readl(&padc->adccon) & ~(0xff << 6), &padc->adccon);
+ /* set prescaler */
+ writel(readl(&padc->adccon) | ((65 << 6) | ADC_PRSCEN), &padc->adccon);
/*
* Wait some time to avoid problem with very first call of
@@ -459,22 +462,21 @@ static void adc_init (void)
* value is 0. Perhaps because the * adjustment of prescaler takes
* some clock cycles?
*/
- udelay (1000);
+ udelay(1000);
return;
}
-
-int do_buttons (void)
+int do_buttons(void)
{
int result;
int i;
- result = *CPLD_BUTTONS; /* read CPLD */
- debug ("%s: cpld_taster (32 bit) %#x\n", __FUNCTION__, result);
+ result = *CPLD_BUTTONS; /* read CPLD */
+ debug("%s: cpld_taster (32 bit) %#x\n", __FUNCTION__, result);
/* print result to console */
- print_identifier ();
+ print_identifier();
for (i = 16; i <= 19; i++) {
if ((result & (1 << i)) == 0)
printf("0");
@@ -485,34 +487,32 @@ int do_buttons (void)
return 0;
}
-
-int do_power_switch (void)
+int do_power_switch(void)
{
int result;
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* configure GPE7 as input */
- gpio->PECON &= ~(0x3 << (2 * 7));
+ writel(readl(&gpio->pecon) & ~(0x3 << (2 * 7)), &gpio->pecon);
/* signal GPE7 from power switch is low active: 0=on , 1=off */
- result = ((gpio->PEDAT & (1 << 7)) == (1 << 7)) ? 0 : 1;
+ result = ((readl(&gpio->pedat) & (1 << 7)) == (1 << 7)) ? 0 : 1;
- print_identifier ();
+ print_identifier();
printf("%d\n", result);
return 0;
}
-
-int do_fill_level (void)
+int do_fill_level(void)
{
int result;
- result = *CPLD_FILL_LEVEL; /* read CPLD */
- debug ("%s: cpld_fuellstand (32 bit) %#x\n", __FUNCTION__, result);
+ result = *CPLD_FILL_LEVEL; /* read CPLD */
+ debug("%s: cpld_fuellstand (32 bit) %#x\n", __FUNCTION__, result);
/* print result to console */
- print_identifier ();
+ print_identifier();
if ((result & (1 << 16)) == 0)
printf("0\n");
else
@@ -520,8 +520,7 @@ int do_fill_level (void)
return 0;
}
-
-int do_rotary_switch (void)
+int do_rotary_switch(void)
{
int result;
/*
@@ -531,13 +530,13 @@ int do_rotary_switch (void)
* proper values.
*/
- result = *CPLD_ROTARY_SWITCH; /* read CPLD */
- debug ("%s: cpld_inc (32 bit) %#x\n", __FUNCTION__, result);
+ result = *CPLD_ROTARY_SWITCH; /* read CPLD */
+ debug("%s: cpld_inc (32 bit) %#x\n", __FUNCTION__, result);
- *CPLD_ROTARY_SWITCH |= (3 << 16); /* clear direction bits in CPLD */
+ *CPLD_ROTARY_SWITCH |= (3 << 16); /* clear direction bits in CPLD */
/* print result to console */
- print_identifier ();
+ print_identifier();
if ((result & (1 << 16)) == (1 << 16))
printf("R");
if ((result & (1 << 17)) == (1 << 17))
@@ -551,30 +550,29 @@ int do_rotary_switch (void)
return 0;
}
-
-int do_vfd_id (void)
+int do_vfd_id(void)
{
int i;
long int pcup_old, pccon_old;
int vfd_board_id;
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* try to red vfd board id from the value defined by pull-ups */
- pcup_old = gpio->PCUP;
- pccon_old = gpio->PCCON;
+ pcup_old = gpio->pcup;
+ pccon_old = gpio->pccon;
- gpio->PCUP = (gpio->PCUP & 0xFFF0); /* activate GPC0...GPC3 pull-ups */
- gpio->PCCON = (gpio->PCCON & 0xFFFFFF00); /* configure GPC0...GPC3 as
- * inputs */
- udelay (10); /* allow signals to settle */
- vfd_board_id = (~gpio->PCDAT) & 0x000F; /* read GPC0...GPC3 port pins */
+ gpio->pcup = (gpio->pcup & 0xFFF0); /* activate GPC0...GPC3 pull-ups */
+ gpio->pccon = (gpio->pccon & 0xFFFFFF00); /* configure GPC0...GPC3 as
+ * inputs */
+ udelay(10); /* allow signals to settle */
+ vfd_board_id = (~gpio->pcdat) & 0x000F; /* read GPC0...GPC3 port pins */
- gpio->PCCON = pccon_old;
- gpio->PCUP = pcup_old;
+ gpio->pccon = pccon_old;
+ gpio->pcup = pcup_old;
/* print vfd_board_id to console */
- print_identifier ();
+ print_identifier();
for (i = 0; i < 4; i++) {
if ((vfd_board_id & (1 << i)) == 0)
printf("0");
@@ -585,67 +583,66 @@ int do_vfd_id (void)
return 0;
}
-int do_buzzer (char **argv)
+int do_buzzer(char **argv)
{
int counter;
- struct s3c24x0_timers * const timers = s3c24x0_get_base_timers();
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_timers *const timers = s3c24x0_get_base_timers();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* set prescaler for timer 2, 3 and 4 */
- timers->TCFG0 &= ~0xFF00;
- timers->TCFG0 |= 0x0F00;
+ writel(readl(&timers->tcfg0) & ~0xFF00, &timers->tcfg0);
+ writel(readl(&timers->tcfg0) | 0x0F00, &timers->tcfg0);
/* set divider for timer 2 */
- timers->TCFG1 &= ~0xF00;
- timers->TCFG1 |= 0x300;
+ writel(readl(&timers->tcfg1) & ~0xF00, &timers->tcfg1);
+ writel(readl(&timers->tcfg1) | 0x300, &timers->tcfg1);
/* set frequency */
counter = (PCLK / BUZZER_FREQ) >> 9;
- timers->ch[2].TCNTB = counter;
- timers->ch[2].TCMPB = counter / 2;
+ writel(counter, &timers->ch[2].tcntb);
+ writel(counter / 2, &timers->ch[2].tcmpb);
- if (strcmp (argv[2], "on") == 0) {
- debug ("%s: frequency: %d\n", __FUNCTION__,
- BUZZER_FREQ);
+ if (strcmp(argv[2], "on") == 0) {
+ debug("%s: frequency: %d\n", __FUNCTION__, BUZZER_FREQ);
/* configure pin GPD7 as TOUT2 */
- gpio->PDCON &= ~0xC000;
- gpio->PDCON |= 0x8000;
+ writel(readl(&gpio->pdcon) & ~0xC000, &gpio->pdcon);
+ writel(readl(&gpio->pdcon) | 0x8000, &gpio->pdcon);
/* start */
- timers->TCON = (timers->TCON | UPDATE2 | RELOAD2) &
- ~INVERT2;
- timers->TCON = (timers->TCON | START2) & ~UPDATE2;
+ writel((readl(&timers->tcon) | UPDATE2 | RELOAD2) & ~INVERT2,
+ &timers->tcon);
+ writel((readl(&timers->tcon) | START2) & ~UPDATE2,
+ &timers->tcon);
return (0);
- }
- else if (strcmp (argv[2], "off") == 0) {
+ } else if (strcmp(argv[2], "off") == 0) {
/* stop */
- timers->TCON &= ~(START2 | RELOAD2);
+ writel(readl(&timers->tcon) & ~(START2 | RELOAD2),
+ &timers->tcon);
/* configure GPD7 as output and set to low */
- gpio->PDCON &= ~0xC000;
- gpio->PDCON |= 0x4000;
- gpio->PDDAT &= ~0x80;
+ writel(readl(&gpio->pdcon) & ~0xC000, &gpio->pdcon);
+ writel(readl(&gpio->pdcon) | 0x4000, &gpio->pdcon);
+ writel(readl(&gpio->pddat) & ~0x80, &gpio->pddat);
return (0);
}
- printf ("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
return 1;
}
-
-int do_led (char **argv)
+int do_led(char **argv)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* configure PC14 and PC15 as output */
- gpio->PCCON &= ~(0xF << 28);
- gpio->PCCON |= (0x5 << 28);
+ writel(readl(&gpio->pccon) & ~(0xF << 28), &gpio->pccon);
+ writel(readl(&gpio->pccon) | (0x5 << 28), &gpio->pccon);
/* configure PD0 and PD4 as output */
- gpio->PDCON &= ~((0x3 << 8) | 0x3);
- gpio->PDCON |= ((0x1 << 8) | 0x1);
+ writel(readl(&gpio->pccon) & ~((0x3 << 8) | 0x3), &gpio->pdcon);
+ writel(readl(&gpio->pccon) | ((0x1 << 8) | 0x1), &gpio->pdcon);
switch (simple_strtoul(argv[2], NULL, 10)) {
@@ -654,101 +651,98 @@ int do_led (char **argv)
break;
case 2:
- if (strcmp (argv[3], "on") == 0)
- gpio->PCDAT |= (1 << 14);
+ if (strcmp(argv[3], "on") == 0)
+ writel(readl(&gpio->pcdat) | (1 << 14), &gpio->pcdat);
else
- gpio->PCDAT &= ~(1 << 14);
+ writel(readl(&gpio->pcdat) & ~(1 << 14), &gpio->pcdat);
return 0;
case 3:
- if (strcmp (argv[3], "on") == 0)
- gpio->PCDAT |= (1 << 15);
+ if (strcmp(argv[3], "on") == 0)
+ writel(readl(&gpio->pcdat) | (1 << 15), &gpio->pcdat);
else
- gpio->PCDAT &= ~(1 << 15);
+ writel(readl(&gpio->pcdat) & ~(1 << 15), &gpio->pcdat);
return 0;
case 4:
- if (strcmp (argv[3], "on") == 0)
- gpio->PDDAT |= (1 << 0);
+ if (strcmp(argv[3], "on") == 0)
+ writel(readl(&gpio->pddat) | (1 << 0), &gpio->pddat);
else
- gpio->PDDAT &= ~(1 << 0);
+ writel(readl(&gpio->pddat) & ~(1 << 0), &gpio->pddat);
return 0;
case 5:
- if (strcmp (argv[3], "on") == 0)
- gpio->PDDAT |= (1 << 4);
+ if (strcmp(argv[3], "on") == 0)
+ writel(readl(&gpio->pddat) | (1 << 4), &gpio->pddat);
else
- gpio->PDDAT &= ~(1 << 4);
+ writel(readl(&gpio->pddat) & ~(1 << 4), &gpio->pddat);
return 0;
default:
break;
}
- printf ("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
return 1;
}
-
-int do_full_bridge (char **argv)
+int do_full_bridge(char **argv)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* configure PD5 and PD6 as output */
- gpio->PDCON &= ~((0x3 << 5*2) | (0x3 << 6*2));
- gpio->PDCON |= ((0x1 << 5*2) | (0x1 << 6*2));
-
- if (strcmp (argv[2], "+") == 0) {
- gpio->PDDAT |= (1 << 5);
- gpio->PDDAT |= (1 << 6);
- return 0;
- }
- else if (strcmp (argv[2], "-") == 0) {
- gpio->PDDAT &= ~(1 << 5);
- gpio->PDDAT |= (1 << 6);
+ writel(readl(&gpio->pdcon) & ~((0x3 << 5 * 2) | (0x3 << 6 * 2)),
+ &gpio->pdcon);
+ writel(readl(&gpio->pdcon) | ((0x1 << 5 * 2) | (0x1 << 6 * 2)),
+ &gpio->pdcon);
+
+ if (strcmp(argv[2], "+") == 0) {
+ writel(readl(&gpio->pddat) | (1 << 5), &gpio->pddat);
+ writel(readl(&gpio->pddat) | (1 << 6), &gpio->pddat);
return 0;
- }
- else if (strcmp (argv[2], "off") == 0) {
- gpio->PDDAT &= ~(1 << 5);
- gpio->PDDAT &= ~(1 << 6);
+ } else if (strcmp(argv[2], "-") == 0) {
+ writel(readl(&gpio->pddat) & ~(1 << 5), &gpio->pddat);
+ writel(readl(&gpio->pddat) | (1 << 6), &gpio->pddat);
+ return 0;
+ } else if (strcmp(argv[2], "off") == 0) {
+ writel(readl(&gpio->pddat) & ~(1 << 5), &gpio->pddat);
+ writel(readl(&gpio->pddat) & ~(1 << 6), &gpio->pddat);
return 0;
}
- printf ("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
return 1;
}
/* val must be in [0, 4095] */
-static inline unsigned long tsc2000_to_uv (u16 val)
+static inline unsigned long tsc2000_to_uv(u16 val)
{
return ((250000 * val) / 4096) * 10;
}
-
-int do_dac (char **argv)
+int do_dac(char **argv)
{
int brightness;
/* initialize SPI */
- tsc2000_spi_init ();
+ tsc2000_spi_init();
- if (((brightness = simple_strtoul (argv[2], NULL, 10)) < 0) ||
- (brightness > 255)) {
- printf ("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
+ if (((brightness = simple_strtoul(argv[2], NULL, 10)) < 0) ||
+ (brightness > 255)) {
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
return 1;
}
- tsc2000_write(TSC2000_REG_DACCTL, 0x0); /* Power up DAC */
+ tsc2000_write(TSC2000_REG_DACCTL, 0x0); /* Power up DAC */
tsc2000_write(TSC2000_REG_DAC, brightness & 0xff);
return 0;
}
-
-int do_v_bat (void)
+int do_v_bat(void)
{
unsigned long ret, res;
/* initialize SPI */
- spi_init ();
+ spi_init();
tsc2000_write(TSC2000_REG_ADC, 0x1836);
@@ -759,39 +753,37 @@ int do_v_bat (void)
res = (tsc2000_to_uv(ret) + 1250) / 2500;
res += (ERROR_BATTERY * res) / 1000;
- print_identifier ();
- printf ("%ld", (res / 100));
- printf (".%ld", ((res % 100) / 10));
- printf ("%ld V\n", (res % 10));
+ print_identifier();
+ printf("%ld", (res / 100));
+ printf(".%ld", ((res % 100) / 10));
+ printf("%ld V\n", (res % 10));
return 0;
}
-
-int do_pressure (void)
+int do_pressure(void)
{
/* initialize SPI */
- spi_init ();
+ spi_init();
tsc2000_write(TSC2000_REG_ADC, 0x2436);
/* now wait for data available */
adc_wait_conversion_done();
- print_identifier ();
- printf ("%d\n", tsc2000_read(TSC2000_REG_AUX2));
+ print_identifier();
+ printf("%d\n", tsc2000_read(TSC2000_REG_AUX2));
return 0;
}
-
-int do_motor_contact (void)
+int do_motor_contact(void)
{
int result;
- result = *CPLD_FILL_LEVEL; /* read CPLD */
- debug ("%s: cpld_fuellstand (32 bit) %#x\n", __FUNCTION__, result);
+ result = *CPLD_FILL_LEVEL; /* read CPLD */
+ debug("%s: cpld_fuellstand (32 bit) %#x\n", __FUNCTION__, result);
/* print result to console */
- print_identifier ();
+ print_identifier();
if ((result & (1 << 17)) == 0)
printf("0\n");
else
@@ -799,241 +791,235 @@ int do_motor_contact (void)
return 0;
}
-int do_motor (char **argv)
+int do_motor(char **argv)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* Configure I/O port */
- gpio->PGCON &= ~(0x3 << 0);
- gpio->PGCON |= (0x1 << 0);
+ writel(readl(&gpio->pgcon) & ~(0x3 << 0), &gpio->pgcon);
+ writel(readl(&gpio->pgcon) | (0x1 << 0), &gpio->pgcon);
- if (strcmp (argv[2], "on") == 0) {
- gpio->PGDAT &= ~(1 << 0);
+ if (strcmp(argv[2], "on") == 0) {
+ writel(readl(&gpio->pgdat) & ~(1 << 0), &gpio->pgdat);
return 0;
}
- if (strcmp (argv[2], "off") == 0) {
- gpio->PGDAT |= (1 << 0);
+ if (strcmp(argv[2], "off") == 0) {
+ writel(readl(&gpio->pgdat) | (1 << 0), &gpio->pgdat);
return 0;
}
- printf ("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
return 1;
}
-static void print_identifier (void)
+static void print_identifier(void)
{
- printf ("## FKT: ");
+ printf("## FKT: ");
}
-int do_pwm (char **argv)
+int do_pwm(char **argv)
{
int counter;
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
- struct s3c24x0_timers * const timers = s3c24x0_get_base_timers();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_timers *const timers = s3c24x0_get_base_timers();
- if (strcmp (argv[2], "on") == 0) {
+ if (strcmp(argv[2], "on") == 0) {
/* configure pin GPD8 as TOUT3 */
- gpio->PDCON &= ~(0x3 << 8*2);
- gpio->PDCON |= (0x2 << 8*2);
+ writel(readl(&gpio->pdcon) & ~(0x3 << 8 * 2), &gpio->pdcon);
+ writel(readl(&gpio->pdcon) | (0x2 << 8 * 2), &gpio->pdcon);
/* set prescaler for timer 2, 3 and 4 */
- timers->TCFG0 &= ~0xFF00;
- timers->TCFG0 |= 0x0F00;
+ writel(readl(&timers->tcfg0) & ~0xFF00, &timers->tcfg0);
+ writel(readl(&timers->tcfg0) | 0x0F00, &timers->tcfg0);
/* set divider for timer 3 */
- timers->TCFG1 &= ~(0xf << 12);
- timers->TCFG1 |= (0x3 << 12);
+ writel(readl(&timers->tcfg1) & ~(0xf << 12), &timers->tcfg1);
+ writel(readl(&timers->tcfg1) | (0x3 << 12), &timers->tcfg1);
/* set frequency */
counter = (PCLK / PWM_FREQ) >> 9;
- timers->ch[3].TCNTB = counter;
- timers->ch[3].TCMPB = counter / 2;
+ writel(counter, &timers->ch[3].tcntb);
+ writel(counter / 2, &timers->ch[3].tcmpb);
/* start timer */
- timers->TCON = (timers->TCON | UPDATE3 | RELOAD3) & ~INVERT3;
- timers->TCON = (timers->TCON | START3) & ~UPDATE3;
+ writel((readl(&timers->tcon) | UPDATE3 | RELOAD3) & ~INVERT3, &timers->tcon);
+ writel((readl(&timers->tcon) | START3) & ~UPDATE3, &timers->tcon);
return 0;
}
- if (strcmp (argv[2], "off") == 0) {
+ if (strcmp(argv[2], "off") == 0) {
/* stop timer */
- timers->TCON &= ~(START2 | RELOAD2);
+ writel(readl(&timers->tcon) & ~(START2 | RELOAD2), &timers->tcon);
/* configure pin GPD8 as output and set to 0 */
- gpio->PDCON &= ~(0x3 << 8*2);
- gpio->PDCON |= (0x1 << 8*2);
- gpio->PDDAT &= ~(1 << 8);
+ writel(readl(&gpio->pdcon) & ~(0x3 << 8 * 2), &gpio->pdcon);
+ writel(readl(&gpio->pdcon) | (0x1 << 8 * 2), &gpio->pdcon);
+ writel(readl(&gpio->pddat) & ~(1 << 8), &gpio->pddat);
return 0;
}
- printf ("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
return 1;
}
-
-int do_thermo (char **argv)
+int do_thermo(char **argv)
{
- int channel, res;
+ int channel, res;
- tsc2000_reg_init ();
+ tsc2000_reg_init();
- if (strcmp (argv[2], "all") == 0) {
+ if (strcmp(argv[2], "all") == 0) {
int i;
- for (i=0; i <= 15; i++) {
+ for (i = 0; i <= 15; i++) {
res = tsc2000_read_channel(i);
- print_identifier ();
- printf ("c%d: %d\n", i, res);
+ print_identifier();
+ printf("c%d: %d\n", i, res);
}
return 0;
}
- channel = simple_strtoul (argv[2], NULL, 10);
+ channel = simple_strtoul(argv[2], NULL, 10);
res = tsc2000_read_channel(channel);
- print_identifier ();
- printf ("%d\n", res);
- return 0; /* return OK */
+ print_identifier();
+ printf("%d\n", res);
+ return 0; /* return OK */
}
-
-int do_touch (char **argv)
+int do_touch(char **argv)
{
- int x, y;
+ int x, y;
- if (strcmp (argv[2], "tl") == 0) {
+ if (strcmp(argv[2], "tl") == 0) {
#ifdef CONFIG_TOUCH_WAIT_PRESSED
touch_wait_pressed();
#else
{
int i;
for (i = 0; i < (TOUCH_TIMEOUT * 1000); i++) {
- if (touch_check_pressed ()) {
+ if (touch_check_pressed()) {
break;
}
- udelay (1000); /* pause 1 ms */
+ udelay(1000); /* pause 1 ms */
}
}
if (!touch_check_pressed()) {
- print_identifier ();
- printf ("error: touch not pressed\n");
+ print_identifier();
+ printf("error: touch not pressed\n");
return 1;
}
#endif /* CONFIG_TOUCH_WAIT_PRESSED */
- touch_read_x_y (&x, &y);
+ touch_read_x_y(&x, &y);
- print_identifier ();
- printf ("x=%d y=%d\n", x, y);
- return touch_write_clibration_values (CALIB_TL, x, y);
- }
- else if (strcmp (argv[2], "dr") == 0) {
+ print_identifier();
+ printf("x=%d y=%d\n", x, y);
+ return touch_write_clibration_values(CALIB_TL, x, y);
+ } else if (strcmp(argv[2], "dr") == 0) {
#ifdef CONFIG_TOUCH_WAIT_PRESSED
touch_wait_pressed();
#else
{
int i;
for (i = 0; i < (TOUCH_TIMEOUT * 1000); i++) {
- if (touch_check_pressed ()) {
+ if (touch_check_pressed()) {
break;
}
- udelay (1000); /* pause 1 ms */
+ udelay(1000); /* pause 1 ms */
}
}
if (!touch_check_pressed()) {
- print_identifier ();
- printf ("error: touch not pressed\n");
+ print_identifier();
+ printf("error: touch not pressed\n");
return 1;
}
#endif /* CONFIG_TOUCH_WAIT_PRESSED */
- touch_read_x_y (&x, &y);
+ touch_read_x_y(&x, &y);
- print_identifier ();
- printf ("x=%d y=%d\n", x, y);
+ print_identifier();
+ printf("x=%d y=%d\n", x, y);
- return touch_write_clibration_values (CALIB_DR, x, y);
+ return touch_write_clibration_values(CALIB_DR, x, y);
}
- return 1; /* not "tl", nor "dr", so return error */
+ return 1; /* not "tl", nor "dr", so return error */
}
-
#ifdef CONFIG_TOUCH_WAIT_PRESSED
-static void touch_wait_pressed (void)
+static void touch_wait_pressed(void)
{
- while (!(tsc2000_read(TSC2000_REG_ADC) & TC_PSM));
+ while (!(tsc2000_read(TSC2000_REG_ADC) & TC_PSM)) ;
}
#else
-static int touch_check_pressed (void)
+static int touch_check_pressed(void)
{
return (tsc2000_read(TSC2000_REG_ADC) & TC_PSM);
}
#endif /* CONFIG_TOUCH_WAIT_PRESSED */
-static int touch_write_clibration_values (int calib_point, int x, int y)
+static int touch_write_clibration_values(int calib_point, int x, int y)
{
#if defined(CONFIG_CMD_I2C)
int x_verify = 0;
int y_verify = 0;
- tsc2000_reg_init ();
+ tsc2000_reg_init();
if (calib_point == CALIB_TL) {
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, TOUCH_X0, 1,
- (unsigned char *)&x, 2)) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, TOUCH_X0, 1,
+ (unsigned char *)&x, 2)) {
return 1;
}
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, TOUCH_Y0, 1,
- (unsigned char *)&y, 2)) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, TOUCH_Y0, 1,
+ (unsigned char *)&y, 2)) {
return 1;
}
/* verify written values */
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, TOUCH_X0, 1,
- (unsigned char *)&x_verify, 2)) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, TOUCH_X0, 1,
+ (unsigned char *)&x_verify, 2)) {
return 1;
}
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, TOUCH_Y0, 1,
- (unsigned char *)&y_verify, 2)) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, TOUCH_Y0, 1,
+ (unsigned char *)&y_verify, 2)) {
return 1;
}
if ((y != y_verify) || (x != x_verify)) {
- print_identifier ();
- printf ("error: verify error\n");
+ print_identifier();
+ printf("error: verify error\n");
return 1;
}
- return 0; /* no error */
- }
- else if (calib_point == CALIB_DR) {
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, TOUCH_X1, 1,
- (unsigned char *)&x, 2)) {
+ return 0; /* no error */
+ } else if (calib_point == CALIB_DR) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, TOUCH_X1, 1,
+ (unsigned char *)&x, 2)) {
return 1;
- }
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, TOUCH_Y1, 1,
- (unsigned char *)&y, 2)) {
+ }
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, TOUCH_Y1, 1,
+ (unsigned char *)&y, 2)) {
return 1;
}
/* verify written values */
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, TOUCH_X1, 1,
- (unsigned char *)&x_verify, 2)) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, TOUCH_X1, 1,
+ (unsigned char *)&x_verify, 2)) {
return 1;
}
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, TOUCH_Y1, 1,
- (unsigned char *)&y_verify, 2)) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, TOUCH_Y1, 1,
+ (unsigned char *)&y_verify, 2)) {
return 1;
}
if ((y != y_verify) || (x != x_verify)) {
- print_identifier ();
- printf ("error: verify error\n");
+ print_identifier();
+ printf("error: verify error\n");
return 1;
}
return 0;
}
return 1;
#else
- printf ("No I2C support enabled (CONFIG_CMD_I2C), could not write "
- "to EEPROM\n");
+ printf("No I2C support enabled (CONFIG_CMD_I2C), could not write "
+ "to EEPROM\n");
return (1);
#endif
}
-
-static void touch_read_x_y (int *px, int *py)
+static void touch_read_x_y(int *px, int *py)
{
tsc2000_write(TSC2000_REG_ADC, DEFAULT_ADC | TC_AD0 | TC_AD1);
adc_wait_conversion_done();
@@ -1044,64 +1030,59 @@ static void touch_read_x_y (int *px, int *py)
*py = tsc2000_read(TSC2000_REG_Y);
}
-
-int do_rs485 (char **argv)
+int do_rs485(char **argv)
{
int timeout;
char data[RS485_MAX_RECEIVE_BUF_LEN];
- if (strcmp (argv[2], "send") == 0) {
- return (rs485_send_line (argv[3]));
- }
- else if (strcmp (argv[2], "receive") == 0) {
+ if (strcmp(argv[2], "send") == 0) {
+ return (rs485_send_line(argv[3]));
+ } else if (strcmp(argv[2], "receive") == 0) {
timeout = simple_strtoul(argv[3], NULL, 10);
- if (rs485_receive_chars (data, timeout) != 0) {
- print_identifier ();
- printf ("## nothing received\n");
+ if (rs485_receive_chars(data, timeout) != 0) {
+ print_identifier();
+ printf("## nothing received\n");
return (1);
- }
- else {
- print_identifier ();
- printf ("%s\n", data);
+ } else {
+ print_identifier();
+ printf("%s\n", data);
return (0);
}
}
- printf ("%s: unknown command %s\n", __FUNCTION__, argv[2]);
- return (1); /* unknown command, return error */
+ printf("%s: unknown command %s\n", __FUNCTION__, argv[2]);
+ return (1); /* unknown command, return error */
}
-
-static int rs485_send_line (const char *data)
+static int rs485_send_line(const char *data)
{
- rs485_init ();
- trab_rs485_enable_tx ();
- rs485_puts (data);
- rs485_putc ('\n');
+ rs485_init();
+ trab_rs485_enable_tx();
+ rs485_puts(data);
+ rs485_putc('\n');
return (0);
}
-
-static int rs485_receive_chars (char *data, int timeout)
+static int rs485_receive_chars(char *data, int timeout)
{
int i;
int receive_count = 0;
- rs485_init ();
- trab_rs485_enable_rx ();
+ rs485_init();
+ trab_rs485_enable_rx();
/* test every 1 ms for received characters to avoid a receive FIFO
* overrun (@ 38.400 Baud) */
for (i = 0; i < (timeout * 1000); i++) {
- while (rs485_tstc ()) {
- if (receive_count >= RS485_MAX_RECEIVE_BUF_LEN-1)
+ while (rs485_tstc()) {
+ if (receive_count >= RS485_MAX_RECEIVE_BUF_LEN - 1)
break;
- *data++ = rs485_getc ();
+ *data++ = rs485_getc();
receive_count++;
}
- udelay (1000); /* pause 1 ms */
+ udelay(1000); /* pause 1 ms */
}
- *data = '\0'; /* terminate string */
+ *data = '\0'; /* terminate string */
if (receive_count == 0)
return (1);
@@ -1109,71 +1090,67 @@ static int rs485_receive_chars (char *data, int timeout)
return (0);
}
-
-int do_serial_number (char **argv)
+int do_serial_number(char **argv)
{
#if defined(CONFIG_CMD_I2C)
unsigned int serial_number;
- if (strcmp (argv[2], "read") == 0) {
- if (i2c_read (I2C_EEPROM_DEV_ADDR, SERIAL_NUMBER, 1,
- (unsigned char *)&serial_number, 4)) {
- printf ("could not read from eeprom\n");
+ if (strcmp(argv[2], "read") == 0) {
+ if (i2c_read(I2C_EEPROM_DEV_ADDR, SERIAL_NUMBER, 1,
+ (unsigned char *)&serial_number, 4)) {
+ printf("could not read from eeprom\n");
return (1);
}
- print_identifier ();
- printf ("%08d\n", serial_number);
+ print_identifier();
+ printf("%08d\n", serial_number);
return (0);
- }
- else if (strcmp (argv[2], "write") == 0) {
+ } else if (strcmp(argv[2], "write") == 0) {
serial_number = simple_strtoul(argv[3], NULL, 10);
- if (i2c_write (I2C_EEPROM_DEV_ADDR, SERIAL_NUMBER, 1,
+ if (i2c_write(I2C_EEPROM_DEV_ADDR, SERIAL_NUMBER, 1,
(unsigned char *)&serial_number, 4)) {
- printf ("could not write to eeprom\n");
+ printf("could not write to eeprom\n");
return (1);
}
return (0);
}
- printf ("%s: unknown command %s\n", __FUNCTION__, argv[2]);
- return (1); /* unknown command, return error */
+ printf("%s: unknown command %s\n", __FUNCTION__, argv[2]);
+ return (1); /* unknown command, return error */
#else
- printf ("No I2C support enabled (CONFIG_CMD_I2C), could not write "
- "to EEPROM\n");
+ printf("No I2C support enabled (CONFIG_CMD_I2C), could not write "
+ "to EEPROM\n");
return (1);
#endif
}
-
-int do_crc16 (void)
+int do_crc16(void)
{
#if defined(CONFIG_CMD_I2C)
int crc;
unsigned char buf[EEPROM_MAX_CRC_BUF];
- if (i2c_read (I2C_EEPROM_DEV_ADDR, 0, 1, buf, 60)) {
- printf ("could not read from eeprom\n");
+ if (i2c_read(I2C_EEPROM_DEV_ADDR, 0, 1, buf, 60)) {
+ printf("could not read from eeprom\n");
return (1);
}
- crc = 0; /* start value of crc calculation */
- crc = updcrc (crc, buf, 60);
+ crc = 0; /* start value of crc calculation */
+ crc = updcrc(crc, buf, 60);
- print_identifier ();
- printf ("crc16=%#04x\n", crc);
+ print_identifier();
+ printf("crc16=%#04x\n", crc);
- if (i2c_write (I2C_EEPROM_DEV_ADDR, CRC16, 1, (unsigned char *)&crc,
- sizeof (crc))) {
- printf ("could not read from eeprom\n");
+ if (i2c_write(I2C_EEPROM_DEV_ADDR, CRC16, 1, (unsigned char *)&crc,
+ sizeof(crc))) {
+ printf("could not read from eeprom\n");
return (1);
}
return (0);
#else
- printf ("No I2C support enabled (CONFIG_CMD_I2C), could not write "
- "to EEPROM\n");
+ printf("No I2C support enabled (CONFIG_CMD_I2C), could not write "
+ "to EEPROM\n");
return (1);
#endif
}
-
/*
* Calculate, intelligently, the CRC of a dataset incrementally given a
* buffer full at a time.
@@ -1200,93 +1177,90 @@ int do_crc16 (void)
/* this the number of bits per char: don't change it. */
#define B 8
-static unsigned short crctab[1<<B] = { /* as calculated by initcrctab() */
- 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
- 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
- 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
- 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
- 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
- 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
- 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
- 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
- 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
- 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
- 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
- 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
- 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
- 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
- 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
- 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
- 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
- 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
- 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
- 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
- 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
- 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
- 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
- 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
- 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
- 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
- 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
- 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
- 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
- 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
- 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
- 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
- };
+static unsigned short crctab[1 << B] = { /* as calculated by initcrctab() */
+ 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
+ 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
+ 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
+ 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
+ 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
+ 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
+ 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
+ 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
+ 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
+ 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
+ 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
+ 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
+ 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
+ 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
+ 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
+ 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
+ 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
+ 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
+ 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
+ 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
+ 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
+ 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
+ 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
+ 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
+ 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
+ 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
+ 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
+ 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
+ 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
+ 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
+ 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
+ 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0
+};
static unsigned short updcrc(unsigned short icrc, unsigned char *icp,
- unsigned int icnt )
+ unsigned int icnt)
{
register unsigned short crc = icrc;
register unsigned char *cp = icp;
register unsigned int cnt = icnt;
while (cnt--)
- crc = (crc<<B) ^ crctab[(crc>>(W-B)) ^ *cp++];
+ crc = (crc << B) ^ crctab[(crc >> (W - B)) ^ *cp++];
return (crc);
}
-
-int do_gain (char **argv)
+int do_gain(char **argv)
{
int range;
- range = simple_strtoul (argv[2], NULL, 10);
- if ((range < 1) || (range > 3))
- {
- printf ("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
+ range = simple_strtoul(argv[2], NULL, 10);
+ if ((range < 1) || (range > 3)) {
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
return 1;
}
- tsc2000_set_range (range);
+ tsc2000_set_range(range);
return (0);
}
-
-int do_eeprom (char **argv)
+int do_eeprom(char **argv)
{
#if defined(CONFIG_CMD_I2C)
- if (strcmp (argv[2], "read") == 0) {
- return (trab_eeprom_read (argv));
+ if (strcmp(argv[2], "read") == 0) {
+ return (trab_eeprom_read(argv));
}
- else if (strcmp (argv[2], "write") == 0) {
- return (trab_eeprom_write (argv));
+ else if (strcmp(argv[2], "write") == 0) {
+ return (trab_eeprom_write(argv));
}
- printf ("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[2]);
return (1);
#else
- printf ("No I2C support enabled (CONFIG_CMD_I2C), could not write "
- "to EEPROM\n");
+ printf("No I2C support enabled (CONFIG_CMD_I2C), could not write "
+ "to EEPROM\n");
return (1);
#endif
}
#if defined(CONFIG_CMD_I2C)
-static int trab_eeprom_read (char **argv)
+static int trab_eeprom_read(char **argv)
{
int i;
int len;
@@ -1294,44 +1268,42 @@ static int trab_eeprom_read (char **argv)
long int value = 0;
uchar *buffer;
- buffer = (uchar *) &value;
- addr = simple_strtoul (argv[3], NULL, 10);
+ buffer = (uchar *) & value;
+ addr = simple_strtoul(argv[3], NULL, 10);
addr &= 0xfff;
- len = simple_strtoul (argv[4], NULL, 10);
+ len = simple_strtoul(argv[4], NULL, 10);
if ((len < 1) || (len > 4)) {
- printf ("%s: invalid parameter %s\n", __FUNCTION__,
- argv[4]);
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[4]);
return (1);
}
for (i = 0; i < len; i++) {
- if (i2c_read (I2C_EEPROM_DEV_ADDR, addr+i, 1, buffer+i, 1)) {
- printf ("%s: could not read from i2c device %#x"
- ", addr %d\n", __FUNCTION__,
- I2C_EEPROM_DEV_ADDR, addr);
+ if (i2c_read(I2C_EEPROM_DEV_ADDR, addr + i, 1, buffer + i, 1)) {
+ printf("%s: could not read from i2c device %#x"
+ ", addr %d\n", __FUNCTION__,
+ I2C_EEPROM_DEV_ADDR, addr);
return (1);
}
}
- print_identifier ();
- if (strcmp (argv[5], "-") == 0) {
+ print_identifier();
+ if (strcmp(argv[5], "-") == 0) {
if (len == 1)
- printf ("%d\n", (signed char) value);
+ printf("%d\n", (signed char)value);
else if (len == 2)
- printf ("%d\n", (signed short int) value);
+ printf("%d\n", (signed short int)value);
else
- printf ("%ld\n", value);
- }
- else {
+ printf("%ld\n", value);
+ } else {
if (len == 1)
- printf ("%d\n", (unsigned char) value);
+ printf("%d\n", (unsigned char)value);
else if (len == 2)
- printf ("%d\n", (unsigned short int) value);
+ printf("%d\n", (unsigned short int)value);
else
- printf ("%ld\n", (unsigned long int) value);
+ printf("%ld\n", (unsigned long int)value);
}
return (0);
}
-static int trab_eeprom_write (char **argv)
+static int trab_eeprom_write(char **argv)
{
int i;
int len;
@@ -1339,77 +1311,74 @@ static int trab_eeprom_write (char **argv)
long int value = 0;
uchar *buffer;
- buffer = (uchar *) &value;
- addr = simple_strtoul (argv[3], NULL, 10);
+ buffer = (uchar *) & value;
+ addr = simple_strtoul(argv[3], NULL, 10);
addr &= 0xfff;
- len = simple_strtoul (argv[4], NULL, 10);
+ len = simple_strtoul(argv[4], NULL, 10);
if ((len < 1) || (len > 4)) {
- printf ("%s: invalid parameter %s\n", __FUNCTION__,
- argv[4]);
+ printf("%s: invalid parameter %s\n", __FUNCTION__, argv[4]);
return (1);
}
- value = simple_strtol (argv[5], NULL, 10);
- debug ("value=%ld\n", value);
+ value = simple_strtol(argv[5], NULL, 10);
+ debug("value=%ld\n", value);
for (i = 0; i < len; i++) {
- if (i2c_write (I2C_EEPROM_DEV_ADDR, addr+i, 1, buffer+i, 1)) {
- printf ("%s: could not write to i2c device %d"
- ", addr %d\n", __FUNCTION__,
- I2C_EEPROM_DEV_ADDR, addr);
+ if (i2c_write(I2C_EEPROM_DEV_ADDR, addr + i, 1, buffer + i, 1)) {
+ printf("%s: could not write to i2c device %d"
+ ", addr %d\n", __FUNCTION__,
+ I2C_EEPROM_DEV_ADDR, addr);
return (1);
}
#if 0
- printf ("chip=%#x, addr+i=%#x+%d=%p, alen=%d, *buffer+i="
- "%#x+%d=%p=%#x \n",I2C_EEPROM_DEV_ADDR_DEV_ADDR , addr,
- i, addr+i, 1, buffer, i, buffer+i, *(buffer+i));
+ printf("chip=%#x, addr+i=%#x+%d=%p, alen=%d, *buffer+i="
+ "%#x+%d=%p=%#x \n", I2C_EEPROM_DEV_ADDR_DEV_ADDR, addr,
+ i, addr + i, 1, buffer, i, buffer + i, *(buffer + i));
#endif
- udelay (30000); /* wait for EEPROM ready */
+ udelay(30000); /* wait for EEPROM ready */
}
return (0);
}
-int i2c_write_multiple (uchar chip, uint addr, int alen,
- uchar *buffer, int len)
+int i2c_write_multiple(uchar chip, uint addr, int alen, uchar * buffer, int len)
{
int i;
if (alen != 1) {
- printf ("%s: addr len other than 1 not supported\n",
- __FUNCTION__);
+ printf("%s: addr len other than 1 not supported\n",
+ __FUNCTION__);
return (1);
}
for (i = 0; i < len; i++) {
- if (i2c_write (chip, addr+i, alen, buffer+i, 1)) {
- printf ("%s: could not write to i2c device %d"
- ", addr %d\n", __FUNCTION__, chip, addr);
+ if (i2c_write(chip, addr + i, alen, buffer + i, 1)) {
+ printf("%s: could not write to i2c device %d"
+ ", addr %d\n", __FUNCTION__, chip, addr);
return (1);
}
#if 0
- printf ("chip=%#x, addr+i=%#x+%d=%p, alen=%d, *buffer+i="
- "%#x+%d=%p=\"%.1s\"\n", chip, addr, i, addr+i,
- alen, buffer, i, buffer+i, buffer+i);
+ printf("chip=%#x, addr+i=%#x+%d=%p, alen=%d, *buffer+i="
+ "%#x+%d=%p=\"%.1s\"\n", chip, addr, i, addr + i,
+ alen, buffer, i, buffer + i, buffer + i);
#endif
- udelay (30000);
+ udelay(30000);
}
return (0);
}
-int i2c_read_multiple ( uchar chip, uint addr, int alen,
- uchar *buffer, int len)
+int i2c_read_multiple(uchar chip, uint addr, int alen, uchar * buffer, int len)
{
int i;
if (alen != 1) {
- printf ("%s: addr len other than 1 not supported\n",
- __FUNCTION__);
+ printf("%s: addr len other than 1 not supported\n",
+ __FUNCTION__);
return (1);
}
for (i = 0; i < len; i++) {
- if (i2c_read (chip, addr+i, alen, buffer+i, 1)) {
- printf ("%s: could not read from i2c device %#x"
- ", addr %d\n", __FUNCTION__, chip, addr);
+ if (i2c_read(chip, addr + i, alen, buffer + i, 1)) {
+ printf("%s: could not read from i2c device %#x"
+ ", addr %d\n", __FUNCTION__, chip, addr);
return (1);
}
}
diff --git a/board/trab/tsc2000.c b/board/trab/tsc2000.c
index 5890624..db6387a 100644
--- a/board/trab/tsc2000.c
+++ b/board/trab/tsc2000.c
@@ -45,182 +45,203 @@
void tsc2000_spi_init(void)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
- struct s3c24x0_spi * const spi = s3c24x0_get_base_spi();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_spi *const spi = s3c24x0_get_base_spi();
int i;
/* Configure I/O ports. */
- gpio->PDCON = (gpio->PDCON & 0xF3FFFF) | 0x040000;
- gpio->PGCON = (gpio->PGCON & 0x0F3FFF) | 0x008000;
- gpio->PGCON = (gpio->PGCON & 0x0CFFFF) | 0x020000;
- gpio->PGCON = (gpio->PGCON & 0x03FFFF) | 0x080000;
+ writel((readl(&gpio->pdcon) & 0xF3FFFF) | 0x040000, &gpio->pdcon);
+ writel((readl(&gpio->pgcon) & 0x0F3FFF) | 0x008000, &gpio->pgcon);
+ writel((readl(&gpio->pgcon) & 0x0CFFFF) | 0x020000, &gpio->pgcon);
+ writel((readl(&gpio->pgcon) & 0x03FFFF) | 0x080000, &gpio->pgcon);
- CLR_CS_TOUCH();
+ clr_cs_touch();
- spi->ch[0].SPPRE = 0x1F; /* Baud-rate ca. 514kHz */
- spi->ch[0].SPPIN = 0x01; /* SPI-MOSI holds Level after last bit */
- spi->ch[0].SPCON = 0x1A; /* Polling, Prescaler, Master, CPOL=0,
- CPHA=1 */
+ /* Baud-rate ca. 514kHz */
+ writel(0x1F, &spi->ch[0].sppre);
+ /* SPI-MOSI holds Level after last bit */
+ writel(0x01, &spi->ch[0].sppin);
+ /* Polling, Prescaler, Master, CPOL=0, CPHA=1 */
+ writel(0x1A, &spi->ch[0].spcon);
/* Dummy byte ensures clock to be low. */
for (i = 0; i < 10; i++) {
- spi->ch[0].SPTDAT = 0xFF;
+ writel(0xFF, &spi->ch[0].sptdat);
}
spi_wait_transmit_done();
}
-
void spi_wait_transmit_done(void)
{
- struct s3c24x0_spi * const spi = s3c24x0_get_base_spi();
+ struct s3c24x0_spi *const spi = s3c24x0_get_base_spi();
- while (!(spi->ch[0].SPSTA & 0x01)); /* wait until transfer is done */
+ while (!(spi->ch[0].spsta & 0x01)) ; /* wait until transfer is done */
}
-
void tsc2000_write(unsigned short reg, unsigned short data)
{
- struct s3c24x0_spi * const spi = s3c24x0_get_base_spi();
+ struct s3c24x0_spi *const spi = s3c24x0_get_base_spi();
unsigned int command;
- SET_CS_TOUCH();
+ set_cs_touch();
command = reg;
- spi->ch[0].SPTDAT = (command & 0xFF00) >> 8;
+ writel((command & 0xFF00) >> 8, &spi->ch[0].sptdat);
spi_wait_transmit_done();
- spi->ch[0].SPTDAT = (command & 0x00FF);
+ writel(command & 0x00FF, &spi->ch[0].sptdat);
spi_wait_transmit_done();
- spi->ch[0].SPTDAT = (data & 0xFF00) >> 8;
+ writel((data & 0xFF00) >> 8, &spi->ch[0].sptdat);
spi_wait_transmit_done();
- spi->ch[0].SPTDAT = (data & 0x00FF);
+ writel(data & 0x00FF, &spi->ch[0].sptdat);
spi_wait_transmit_done();
- CLR_CS_TOUCH();
+ clr_cs_touch();
}
-
-unsigned short tsc2000_read (unsigned short reg)
+unsigned short tsc2000_read(unsigned short reg)
{
unsigned short command, data;
- struct s3c24x0_spi * const spi = s3c24x0_get_base_spi();
+ struct s3c24x0_spi *const spi = s3c24x0_get_base_spi();
- SET_CS_TOUCH();
+ set_cs_touch();
command = 0x8000 | reg;
- spi->ch[0].SPTDAT = (command & 0xFF00) >> 8;
+ writel((command & 0xFF00) >> 8, &spi->ch[0].sptdat);
spi_wait_transmit_done();
- spi->ch[0].SPTDAT = (command & 0x00FF);
+ writel(command & 0x00FF, &spi->ch[0].sptdat);
spi_wait_transmit_done();
- spi->ch[0].SPTDAT = 0xFF;
+ writel(0xFF, &spi->ch[0].sptdat);
spi_wait_transmit_done();
- data = spi->ch[0].SPRDAT;
- spi->ch[0].SPTDAT = 0xFF;
+ data = readl(&spi->ch[0].sprdat);
+ writel(0xFF, &spi->ch[0].sptdat);
spi_wait_transmit_done();
- CLR_CS_TOUCH();
- return (spi->ch[0].SPRDAT & 0x0FF) | (data << 8);
+ clr_cs_touch();
+ return (readl(&spi->ch[0].sprdat) & 0x0FF) | (data << 8);
}
-
-void tsc2000_set_mux (unsigned int channel)
+void tsc2000_set_mux(unsigned int channel)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
- CLR_MUX1_ENABLE; CLR_MUX2_ENABLE;
- CLR_MUX3_ENABLE; CLR_MUX4_ENABLE;
+ CLR_MUX1_ENABLE;
+ CLR_MUX2_ENABLE;
+ CLR_MUX3_ENABLE;
+ CLR_MUX4_ENABLE;
switch (channel) {
case 0:
- CLR_MUX0; CLR_MUX1;
+ CLR_MUX0;
+ CLR_MUX1;
SET_MUX1_ENABLE;
break;
case 1:
- SET_MUX0; CLR_MUX1;
+ SET_MUX0;
+ CLR_MUX1;
SET_MUX1_ENABLE;
break;
case 2:
- CLR_MUX0; SET_MUX1;
+ CLR_MUX0;
+ SET_MUX1;
SET_MUX1_ENABLE;
break;
case 3:
- SET_MUX0; SET_MUX1;
+ SET_MUX0;
+ SET_MUX1;
SET_MUX1_ENABLE;
break;
case 4:
- CLR_MUX0; CLR_MUX1;
+ CLR_MUX0;
+ CLR_MUX1;
SET_MUX2_ENABLE;
break;
case 5:
- SET_MUX0; CLR_MUX1;
+ SET_MUX0;
+ CLR_MUX1;
SET_MUX2_ENABLE;
break;
case 6:
- CLR_MUX0; SET_MUX1;
+ CLR_MUX0;
+ SET_MUX1;
SET_MUX2_ENABLE;
break;
case 7:
- SET_MUX0; SET_MUX1;
+ SET_MUX0;
+ SET_MUX1;
SET_MUX2_ENABLE;
break;
case 8:
- CLR_MUX0; CLR_MUX1;
+ CLR_MUX0;
+ CLR_MUX1;
SET_MUX3_ENABLE;
break;
case 9:
- SET_MUX0; CLR_MUX1;
+ SET_MUX0;
+ CLR_MUX1;
SET_MUX3_ENABLE;
break;
case 10:
- CLR_MUX0; SET_MUX1;
+ CLR_MUX0;
+ SET_MUX1;
SET_MUX3_ENABLE;
break;
case 11:
- SET_MUX0; SET_MUX1;
+ SET_MUX0;
+ SET_MUX1;
SET_MUX3_ENABLE;
break;
case 12:
- CLR_MUX0; CLR_MUX1;
+ CLR_MUX0;
+ CLR_MUX1;
SET_MUX4_ENABLE;
break;
case 13:
- SET_MUX0; CLR_MUX1;
+ SET_MUX0;
+ CLR_MUX1;
SET_MUX4_ENABLE;
break;
case 14:
- CLR_MUX0; SET_MUX1;
+ CLR_MUX0;
+ SET_MUX1;
SET_MUX4_ENABLE;
break;
case 15:
- SET_MUX0; SET_MUX1;
+ SET_MUX0;
+ SET_MUX1;
SET_MUX4_ENABLE;
break;
default:
- CLR_MUX0; CLR_MUX1;
+ CLR_MUX0;
+ CLR_MUX1;
}
}
-
-void tsc2000_set_range (unsigned int range)
+void tsc2000_set_range(unsigned int range)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
switch (range) {
case 1:
- CLR_SEL_TEMP_V_0; SET_SEL_TEMP_V_1;
- CLR_SEL_TEMP_V_2; CLR_SEL_TEMP_V_3;
+ CLR_SEL_TEMP_V_0;
+ SET_SEL_TEMP_V_1;
+ CLR_SEL_TEMP_V_2;
+ CLR_SEL_TEMP_V_3;
break;
case 2:
- CLR_SEL_TEMP_V_0; CLR_SEL_TEMP_V_1;
- CLR_SEL_TEMP_V_2; SET_SEL_TEMP_V_3;
+ CLR_SEL_TEMP_V_0;
+ CLR_SEL_TEMP_V_1;
+ CLR_SEL_TEMP_V_2;
+ SET_SEL_TEMP_V_3;
break;
case 3:
- SET_SEL_TEMP_V_0; CLR_SEL_TEMP_V_1;
- SET_SEL_TEMP_V_2; CLR_SEL_TEMP_V_3;
+ SET_SEL_TEMP_V_0;
+ CLR_SEL_TEMP_V_1;
+ SET_SEL_TEMP_V_2;
+ CLR_SEL_TEMP_V_3;
break;
}
}
-
-u16 tsc2000_read_channel (unsigned int channel)
+u16 tsc2000_read_channel(unsigned int channel)
{
u16 res;
@@ -228,21 +249,20 @@ u16 tsc2000_read_channel (unsigned int channel)
udelay(20 * TSC2000_DELAY_BASE);
tsc2000_write(TSC2000_REG_ADC, 0x2036);
- adc_wait_conversion_done ();
+ adc_wait_conversion_done();
res = tsc2000_read(TSC2000_REG_AUX1);
return res;
}
-
-s32 tsc2000_contact_temp (void)
+s32 tsc2000_contact_temp(void)
{
long adc_pt1000, offset;
long u_pt1000;
long contact_temp;
long temp1, temp2;
- tsc2000_reg_init ();
- tsc2000_set_range (3);
+ tsc2000_reg_init();
+ tsc2000_set_range(3);
/*
* Because of sporadic "jumps" in the measured adc values every
@@ -251,37 +271,37 @@ s32 tsc2000_contact_temp (void)
* measurement, because it is very unlikely that a successive third
* measurement goes also wrong.
*/
- temp1 = tsc2000_read_channel (14);
- temp2 = tsc2000_read_channel (14);
+ temp1 = tsc2000_read_channel(14);
+ temp2 = tsc2000_read_channel(14);
if (abs(temp2 - temp1) < MAX_DEVIATION)
adc_pt1000 = temp2;
else {
- printf ("%s: read adc value (channel 14) exceeded max allowed "
- "deviation: %d * 0.0276 °C\n",
- __FUNCTION__, MAX_DEVIATION);
- printf ("adc value 1: %ld DIGITs\nadc value 2: %ld DIGITs\n",
- temp1, temp2);
- adc_pt1000 = tsc2000_read_channel (14);
- printf ("use (third read) adc value: adc_pt1000 = "
- "%ld DIGITs\n", adc_pt1000);
+ printf("%s: read adc value (channel 14) exceeded max allowed "
+ "deviation: %d * 0.0276 °C\n",
+ __FUNCTION__, MAX_DEVIATION);
+ printf("adc value 1: %ld DIGITs\nadc value 2: %ld DIGITs\n",
+ temp1, temp2);
+ adc_pt1000 = tsc2000_read_channel(14);
+ printf("use (third read) adc value: adc_pt1000 = "
+ "%ld DIGITs\n", adc_pt1000);
}
- debug ("read channel 14 (pt1000 adc value): %ld\n", adc_pt1000);
+ debug("read channel 14 (pt1000 adc value): %ld\n", adc_pt1000);
- temp1 = tsc2000_read_channel (15);
- temp2 = tsc2000_read_channel (15);
+ temp1 = tsc2000_read_channel(15);
+ temp2 = tsc2000_read_channel(15);
if (abs(temp2 - temp1) < MAX_DEVIATION)
offset = temp2;
else {
- printf ("%s: read adc value (channel 15) exceeded max allowed "
- "deviation: %d * 0.0276 °C\n",
- __FUNCTION__, MAX_DEVIATION);
- printf ("adc value 1: %ld DIGITs\nadc value 2: %ld DIGITs\n",
- temp1, temp2);
- offset = tsc2000_read_channel (15);
- printf ("use (third read) adc value: offset = %ld DIGITs\n",
- offset);
+ printf("%s: read adc value (channel 15) exceeded max allowed "
+ "deviation: %d * 0.0276 °C\n",
+ __FUNCTION__, MAX_DEVIATION);
+ printf("adc value 1: %ld DIGITs\nadc value 2: %ld DIGITs\n",
+ temp1, temp2);
+ offset = tsc2000_read_channel(15);
+ printf("use (third read) adc value: offset = %ld DIGITs\n",
+ offset);
}
- debug ("read channel 15 (offset): %ld\n", offset);
+ debug("read channel 15 (offset): %ld\n", offset);
/*
* Formula for calculating voltage drop on PT1000 resistor: u_pt1000 =
@@ -291,23 +311,21 @@ s32 tsc2000_contact_temp (void)
* u-boot, because this could cause only a very small error (< 1%).
*/
u_pt1000 = (101750 * (adc_pt1000 - offset)) / 10;
- debug ("u_pt1000: %ld\n", u_pt1000);
+ debug("u_pt1000: %ld\n", u_pt1000);
if (tsc2000_interpolate(u_pt1000, Pt1000_temp_table,
&contact_temp) == -1) {
- printf ("%s: error interpolating PT1000 vlaue\n",
- __FUNCTION__);
+ printf("%s: error interpolating PT1000 vlaue\n", __FUNCTION__);
return (-1000);
}
- debug ("contact_temp: %ld\n", contact_temp);
+ debug("contact_temp: %ld\n", contact_temp);
return contact_temp;
}
-
-void tsc2000_reg_init (void)
+void tsc2000_reg_init(void)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
tsc2000_write(TSC2000_REG_ADC, 0x2036);
tsc2000_write(TSC2000_REG_REF, 0x0011);
@@ -330,7 +348,6 @@ void tsc2000_reg_init (void)
tsc2000_set_range(0);
}
-
int tsc2000_interpolate(long value, long data[][2], long *result)
{
int i;
@@ -348,18 +365,17 @@ int tsc2000_interpolate(long value, long data[][2], long *result)
/* To prevent overflow we have to store the intermediate
result in 'long long'.
- */
+ */
- val = ((unsigned long long)(data[i][1] - data[i-1][1])
- * (unsigned long long)(value - data[i-1][0]));
- do_div(val, (data[i][0] - data[i-1][0]));
- *result = data[i-1][1] + val;
+ val = ((unsigned long long)(data[i][1] - data[i - 1][1])
+ * (unsigned long long)(value - data[i - 1][0]));
+ do_div(val, (data[i][0] - data[i - 1][0]));
+ *result = data[i - 1][1] + val;
return 0;
}
-
void adc_wait_conversion_done(void)
{
- while (!(tsc2000_read(TSC2000_REG_ADC) & (1 << 14)));
+ while (!(tsc2000_read(TSC2000_REG_ADC) & (1 << 14))) ;
}
diff --git a/board/trab/tsc2000.h b/board/trab/tsc2000.h
index 0b6253f..f597398 100644
--- a/board/trab/tsc2000.h
+++ b/board/trab/tsc2000.h
@@ -29,45 +29,45 @@
#define _TSC2000_H_
/* temperature channel multiplexer definitions */
-#define CON_MUX0 (gpio->PCCON = (gpio->PCCON & 0x0FFFFFCFF) | 0x00000100)
-#define CLR_MUX0 (gpio->PCDAT &= 0x0FFEF)
-#define SET_MUX0 (gpio->PCDAT |= 0x00010)
+#define CON_MUX0 writel((readl(&gpio->pccon) & 0x0FFFFFCFF) | 0x00000100, &gpio->pccon)
+#define CLR_MUX0 writel(readl(&gpio->pcdat) & 0x0FFEF, &gpio->pcdat)
+#define SET_MUX0 writel(readl(&gpio->pcdat) | 0x00010, &gpio->pcdat)
-#define CON_MUX1 (gpio->PCCON = (gpio->PCCON & 0x0FFFFF3FF) | 0x00000400)
-#define CLR_MUX1 (gpio->PCDAT &= 0x0FFDF)
-#define SET_MUX1 (gpio->PCDAT |= 0x00020)
+#define CON_MUX1 writel((readl(&gpio->pccon) & 0x0FFFFF3FF) | 0x00000400, &gpio->pccon)
+#define CLR_MUX1 writel(readl(&gpio->pcdat) & 0x0FFDF, &gpio->pcdat)
+#define SET_MUX1 writel(readl(&gpio->pcdat) | 0x00020, &gpio->pcdat)
-#define CON_MUX1_ENABLE (gpio->PCCON = (gpio->PCCON & 0x0FFFFCFFF) | 0x00001000)
-#define CLR_MUX1_ENABLE (gpio->PCDAT |= 0x00040)
-#define SET_MUX1_ENABLE (gpio->PCDAT &= 0x0FFBF)
+#define CON_MUX1_ENABLE writel((readl(&gpio->pccon) & 0x0FFFFCFFF) | 0x00001000, &gpio->pccon)
+#define CLR_MUX1_ENABLE writel(readl(&gpio->pcdat) | 0x00040, &gpio->pcdat)
+#define SET_MUX1_ENABLE writel(readl(&gpio->pcdat) & 0x0FFBF, &gpio->pcdat)
-#define CON_MUX2_ENABLE (gpio->PCCON = (gpio->PCCON & 0x0FFFF3FFF) | 0x00004000)
-#define CLR_MUX2_ENABLE (gpio->PCDAT |= 0x00080)
-#define SET_MUX2_ENABLE (gpio->PCDAT &= 0x0FF7F)
+#define CON_MUX2_ENABLE writel((readl(&gpio->pccon) & 0x0FFFF3FFF) | 0x00004000, &gpio->pccon)
+#define CLR_MUX2_ENABLE writel(readl(&gpio->pcdat) | 0x00080, &gpio->pcdat)
+#define SET_MUX2_ENABLE writel(readl(&gpio->pcdat) & 0x0FF7F, &gpio->pcdat)
-#define CON_MUX3_ENABLE (gpio->PCCON = (gpio->PCCON & 0x0FFFCFFFF) | 0x00010000)
-#define CLR_MUX3_ENABLE (gpio->PCDAT |= 0x00100)
-#define SET_MUX3_ENABLE (gpio->PCDAT &= 0x0FEFF)
+#define CON_MUX3_ENABLE writel((readl(&gpio->pccon) & 0x0FFFCFFFF) | 0x00010000, &gpio->pccon)
+#define CLR_MUX3_ENABLE writel(readl(&gpio->pcdat) | 0x00100, &gpio->pcdat)
+#define SET_MUX3_ENABLE writel(readl(&gpio->pcdat) & 0x0FEFF, &gpio->pcdat)
-#define CON_MUX4_ENABLE (gpio->PCCON = (gpio->PCCON & 0x0FFF3FFFF) | 0x00040000)
-#define CLR_MUX4_ENABLE (gpio->PCDAT |= 0x00200)
-#define SET_MUX4_ENABLE (gpio->PCDAT &= 0x0FDFF)
+#define CON_MUX4_ENABLE writel((readl(&gpio->pccon) & 0x0FFF3FFFF) | 0x00040000, &gpio->pccon)
+#define CLR_MUX4_ENABLE writel(readl(&gpio->pcdat) | 0x00200, &gpio->pcdat)
+#define SET_MUX4_ENABLE writel(readl(&gpio->pcdat) & 0x0FDFF, &gpio->pcdat)
-#define CON_SEL_TEMP_V_0 (gpio->PCCON = (gpio->PCCON & 0x0FFCFFFFF) | 0x00100000)
-#define CLR_SEL_TEMP_V_0 (gpio->PCDAT &= 0x0FBFF)
-#define SET_SEL_TEMP_V_0 (gpio->PCDAT |= 0x00400)
+#define CON_SEL_TEMP_V_0 writel((readl(&gpio->pccon) & 0x0FFCFFFFF) | 0x00100000, &gpio->pccon)
+#define CLR_SEL_TEMP_V_0 writel(readl(&gpio->pcdat) & 0x0FBFF, &gpio->pcdat)
+#define SET_SEL_TEMP_V_0 writel(readl(&gpio->pcdat) | 0x00400, &gpio->pcdat)
-#define CON_SEL_TEMP_V_1 (gpio->PCCON = (gpio->PCCON & 0x0FF3FFFFF) | 0x00400000)
-#define CLR_SEL_TEMP_V_1 (gpio->PCDAT &= 0x0F7FF)
-#define SET_SEL_TEMP_V_1 (gpio->PCDAT |= 0x00800)
+#define CON_SEL_TEMP_V_1 writel((readl(&gpio->pccon) & 0x0FF3FFFFF) | 0x00400000, &gpio->pccon)
+#define CLR_SEL_TEMP_V_1 writel(readl(&gpio->pcdat) & 0x0F7FF, &gpio->pcdat)
+#define SET_SEL_TEMP_V_1 writel(readl(&gpio->pcdat) | 0x00800, &gpio->pcdat)
-#define CON_SEL_TEMP_V_2 (gpio->PCCON = (gpio->PCCON & 0x0FCFFFFFF) | 0x01000000)
-#define CLR_SEL_TEMP_V_2 (gpio->PCDAT &= 0x0EFFF)
-#define SET_SEL_TEMP_V_2 (gpio->PCDAT |= 0x01000)
+#define CON_SEL_TEMP_V_2 writel((readl(&gpio->pccon) & 0x0FCFFFFFF) | 0x01000000, &gpio->pccon)
+#define CLR_SEL_TEMP_V_2 writel(readl(&gpio->pcdat) & 0x0EFFF, &gpio->pcdat)
+#define SET_SEL_TEMP_V_2 writel(readl(&gpio->pcdat) | 0x01000, &gpio->pcdat)
-#define CON_SEL_TEMP_V_3 (gpio->PCCON = (gpio->PCCON & 0x0F3FFFFFF) | 0x04000000)
-#define CLR_SEL_TEMP_V_3 (gpio->PCDAT &= 0x0DFFF)
-#define SET_SEL_TEMP_V_3 (gpio->PCDAT |= 0x02000)
+#define CON_SEL_TEMP_V_3 writel((readl(&gpio->pccon) & 0x0F3FFFFFF) | 0x04000000, &gpio->pccon)
+#define CLR_SEL_TEMP_V_3 writel(readl(&gpio->pcdat) & 0x0DFFF, &gpio->pcdat)
+#define SET_SEL_TEMP_V_3 writel(readl(&gpio->pcdat) | 0x02000, &gpio->pcdat)
/* TSC2000 register definition */
#define TSC2000_REG_X ((0 << 11) | (0 << 5))
@@ -114,31 +114,29 @@
#define ERROR_BATTERY 220 /* must be adjusted, if R68 is changed on TRAB */
void tsc2000_write(unsigned short, unsigned short);
-unsigned short tsc2000_read (unsigned short);
-u16 tsc2000_read_channel (unsigned int);
-void tsc2000_set_mux (unsigned int);
-void tsc2000_set_range (unsigned int);
-void tsc2000_reg_init (void);
-s32 tsc2000_contact_temp (void);
-void spi_wait_transmit_done (void);
+unsigned short tsc2000_read(unsigned short);
+u16 tsc2000_read_channel(unsigned int);
+void tsc2000_set_mux(unsigned int);
+void tsc2000_set_range(unsigned int);
+void tsc2000_reg_init(void);
+s32 tsc2000_contact_temp(void);
+void spi_wait_transmit_done(void);
void tsc2000_spi_init(void);
int tsc2000_interpolate(long value, long data[][2], long *result);
void adc_wait_conversion_done(void);
-
-static inline void SET_CS_TOUCH(void)
+static inline void set_cs_touch(void)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
- gpio->PDDAT &= 0x5FF;
+ writel(readl(&gpio->pddat) & 0x5FF, &gpio->pddat);
}
-
-static inline void CLR_CS_TOUCH(void)
+static inline void clr_cs_touch(void)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
- gpio->PDDAT |= 0x200;
+ writel(readl(&gpio->pddat) | 0x200, &gpio->pddat);
}
-#endif /* _TSC2000_H_ */
+#endif /* _TSC2000_H_ */
diff --git a/board/trab/vfd.c b/board/trab/vfd.c
index b7eb8cc..6e6b68f 100644
--- a/board/trab/vfd.c
+++ b/board/trab/vfd.c
@@ -38,6 +38,7 @@
#include <linux/types.h>
#include <stdio_dev.h>
#include <asm/arch/s3c24x0_cpu.h>
+#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -95,75 +96,95 @@ void init_grid_ctrl(void)
/*
* clear frame buffer (logical clear => set to "black")
*/
- memset ((void *)(gd->fb_base), 0, FRAME_BUF_SIZE);
+ memset((void *)(gd->fb_base), 0, FRAME_BUF_SIZE);
switch (gd->vfd_type) {
case VFD_TYPE_T119C:
- for (display=0; display<4; display++) {
- for(grid_cycle=0; grid_cycle<56; grid_cycle++) {
- bit = grid_cycle * 256 * 4 +
- (grid_cycle + 200) * 4 +
- frame_buf_offs + display;
- /* wrap arround if offset (see manual S3C2400) */
- if (bit>=FRAME_BUF_SIZE*8)
- bit = bit - (FRAME_BUF_SIZE * 8);
- adr = gd->fb_base + (bit/32) * 4 + (3 - (bit%32) / 8);
- bit_nr = bit % 8;
- bit_nr = (bit_nr > 3) ? bit_nr-4 : bit_nr+4;
- temp=(*(volatile unsigned char*)(adr));
- temp |= (1<<bit_nr);
- (*(volatile unsigned char*)(adr))=temp;
-
- if(grid_cycle<55)
- bit = grid_cycle*256*4+(grid_cycle+201)*4+frame_buf_offs+display;
- else
- bit = grid_cycle*256*4+200*4+frame_buf_offs+display-4; /* grid nr. 0 */
- /* wrap arround if offset (see manual S3C2400) */
- if (bit>=FRAME_BUF_SIZE*8)
- bit = bit-(FRAME_BUF_SIZE*8);
- adr = gd->fb_base+(bit/32)*4+(3-(bit%32)/8);
- bit_nr = bit%8;
- bit_nr = (bit_nr>3)?bit_nr-4:bit_nr+4;
- temp=(*(volatile unsigned char*)(adr));
- temp |= (1<<bit_nr);
- (*(volatile unsigned char*)(adr))=temp;
+ for (display = 0; display < 4; display++) {
+ for (grid_cycle = 0; grid_cycle < 56; grid_cycle++) {
+ bit = grid_cycle * 256 * 4 +
+ (grid_cycle + 200) * 4 +
+ frame_buf_offs + display;
+ /* wrap around if offset (see manual S3C2400) */
+ if (bit >= FRAME_BUF_SIZE * 8)
+ bit = bit - (FRAME_BUF_SIZE * 8);
+ adr =
+ gd->fb_base + (bit / 32) * 4 + (3 -
+ (bit % 32) /
+ 8);
+ bit_nr = bit % 8;
+ bit_nr = (bit_nr > 3) ? bit_nr - 4 : bit_nr + 4;
+ temp = (*(volatile unsigned char *)(adr));
+ temp |= (1 << bit_nr);
+ (*(volatile unsigned char *)(adr)) = temp;
+
+ if (grid_cycle < 55)
+ bit =
+ grid_cycle * 256 * 4 + (grid_cycle +
+ 201) * 4 +
+ frame_buf_offs + display;
+ else
+ /* grid nr. 0 */
+ bit = grid_cycle * 256 * 4 + 200 * 4 +
+ frame_buf_offs + display - 4;
+ /* wrap around if offset (see manual S3C2400) */
+ if (bit >= FRAME_BUF_SIZE * 8)
+ bit = bit - (FRAME_BUF_SIZE * 8);
+ adr =
+ gd->fb_base + (bit / 32) * 4 + (3 -
+ (bit % 32) /
+ 8);
+ bit_nr = bit % 8;
+ bit_nr = (bit_nr > 3) ? bit_nr - 4 : bit_nr + 4;
+ temp = (*(volatile unsigned char *)(adr));
+ temp |= (1 << bit_nr);
+ (*(volatile unsigned char *)(adr)) = temp;
+ }
}
- }
- break;
+ break;
case VFD_TYPE_MN11236:
- for (display=0; display<4; display++) {
- for (grid_cycle=0; grid_cycle<38; grid_cycle++) {
- bit = grid_cycle * 256 * 4 +
- (253 - grid_cycle) * 4 +
- frame_buf_offs + display;
- /* wrap arround if offset (see manual S3C2400) */
- if (bit>=FRAME_BUF_SIZE*8)
- bit = bit - (FRAME_BUF_SIZE * 8);
- adr = gd->fb_base + (bit/32) * 4 + (3 - (bit%32) / 8);
- bit_nr = bit % 8;
- bit_nr = (bit_nr > 3) ? bit_nr-4 : bit_nr+4;
- temp=(*(volatile unsigned char*)(adr));
- temp |= (1<<bit_nr);
- (*(volatile unsigned char*)(adr))=temp;
-
- if(grid_cycle<37)
- bit = grid_cycle*256*4+(252-grid_cycle)*4+frame_buf_offs+display;
-
- /* wrap arround if offset (see manual S3C2400) */
- if (bit>=FRAME_BUF_SIZE*8)
- bit = bit-(FRAME_BUF_SIZE*8);
- adr = gd->fb_base+(bit/32)*4+(3-(bit%32)/8);
- bit_nr = bit%8;
- bit_nr = (bit_nr>3)?bit_nr-4:bit_nr+4;
- temp=(*(volatile unsigned char*)(adr));
- temp |= (1<<bit_nr);
- (*(volatile unsigned char*)(adr))=temp;
+ for (display = 0; display < 4; display++) {
+ for (grid_cycle = 0; grid_cycle < 38; grid_cycle++) {
+ bit = grid_cycle * 256 * 4 +
+ (253 - grid_cycle) * 4 +
+ frame_buf_offs + display;
+ /* wrap around if offset (see manual S3C2400) */
+ if (bit >= FRAME_BUF_SIZE * 8)
+ bit = bit - (FRAME_BUF_SIZE * 8);
+ adr =
+ gd->fb_base + (bit / 32) * 4 + (3 -
+ (bit % 32) /
+ 8);
+ bit_nr = bit % 8;
+ bit_nr = (bit_nr > 3) ? bit_nr - 4 : bit_nr + 4;
+ temp = (*(volatile unsigned char *)(adr));
+ temp |= (1 << bit_nr);
+ (*(volatile unsigned char *)(adr)) = temp;
+
+ if (grid_cycle < 37)
+ bit =
+ grid_cycle * 256 * 4 + (252 -
+ grid_cycle)
+ * 4 + frame_buf_offs + display;
+
+ /* wrap around if offset (see manual S3C2400) */
+ if (bit >= FRAME_BUF_SIZE * 8)
+ bit = bit - (FRAME_BUF_SIZE * 8);
+ adr =
+ gd->fb_base + (bit / 32) * 4 + (3 -
+ (bit % 32) /
+ 8);
+ bit_nr = bit % 8;
+ bit_nr = (bit_nr > 3) ? bit_nr - 4 : bit_nr + 4;
+ temp = (*(volatile unsigned char *)(adr));
+ temp |= (1 << bit_nr);
+ (*(volatile unsigned char *)(adr)) = temp;
+ }
}
- }
- break;
+ break;
default:
- printf ("Warning: unknown display type\n");
- break;
+ printf("Warning: unknown display type\n");
+ break;
}
}
@@ -179,63 +200,93 @@ void create_vfd_table(void)
switch (gd->vfd_type) {
case VFD_TYPE_T119C:
- for(y=0; y<=17; y++) { /* Line */
- for(x=0; x<=111; x++) { /* Column */
- for(display=0; display <=3; display++) {
-
- /* Display 0 blue pixels */
- vfd_table[x][y][0][display][0] =
- (x==0) ? y*16+display
- : (x%4)*4+y*16+((x-1)/2)*1024+display;
- /* Display 0 red pixels */
- vfd_table[x][y][1][display][0] =
- (x==0) ? y*16+512+display
- : (x%4)*4+y*16+((x-1)/2)*1024+512+display;
- }
+ for (y = 0; y <= 17; y++) { /* Line */
+ for (x = 0; x <= 111; x++) { /* Column */
+ for (display = 0; display <= 3; display++) {
+
+ /* Display 0 blue pixels */
+ vfd_table[x][y][0][display][0] =
+ (x == 0) ? y * 16 + display
+ : (x % 4) * 4 + y * 16 +
+ ((x - 1) / 2) * 1024 + display;
+ /* Display 0 red pixels */
+ vfd_table[x][y][1][display][0] =
+ (x == 0) ? y * 16 + 512 + display
+ : (x % 4) * 4 + y * 16 +
+ ((x - 1) / 2) * 1024 + 512 +
+ display;
+ }
+ }
}
- }
- break;
+ break;
case VFD_TYPE_MN11236:
- for(y=0; y<=17; y++) { /* Line */
- for(x=0; x<=111; x++) { /* Column */
- for(display=0; display <=3; display++) {
-
- vfd_table[x][y][0][display][0]=0;
- vfd_table[x][y][0][display][1]=0;
- vfd_table[x][y][1][display][0]=0;
- vfd_table[x][y][1][display][1]=0;
-
- switch (x%6) {
- case 0: x_abcdef=0; break; /* a -> a */
- case 1: x_abcdef=2; break; /* b -> c */
- case 2: x_abcdef=4; break; /* c -> e */
- case 3: x_abcdef=5; break; /* d -> f */
- case 4: x_abcdef=3; break; /* e -> d */
- case 5: x_abcdef=1; break; /* f -> b */
- }
-
- /* blue pixels */
- vfd_table[x][y][0][display][0] =
- (x>1) ? x_abcdef*4+((x-1)/3)*1024+y*48+display
- : x_abcdef*4+ 0+y*48+display;
- /* blue pixels */
- if (x>1 && (x-1)%3)
- vfd_table[x][y][0][display][1] = x_abcdef*4+((x-1)/3+1)*1024+y*48+display;
-
- /* red pixels */
- vfd_table[x][y][1][display][0] =
- (x>1) ? x_abcdef*4+24+((x-1)/3)*1024+y*48+display
- : x_abcdef*4+24+ 0+y*48+display;
- /* red pixels */
- if (x>1 && (x-1)%3)
- vfd_table[x][y][1][display][1] = x_abcdef*4+24+((x-1)/3+1)*1024+y*48+display;
- }
+ for (y = 0; y <= 17; y++) { /* Line */
+ for (x = 0; x <= 111; x++) { /* Column */
+ for (display = 0; display <= 3; display++) {
+
+ vfd_table[x][y][0][display][0] = 0;
+ vfd_table[x][y][0][display][1] = 0;
+ vfd_table[x][y][1][display][0] = 0;
+ vfd_table[x][y][1][display][1] = 0;
+
+ switch (x % 6) {
+ case 0:
+ x_abcdef = 0;
+ break; /* a -> a */
+ case 1:
+ x_abcdef = 2;
+ break; /* b -> c */
+ case 2:
+ x_abcdef = 4;
+ break; /* c -> e */
+ case 3:
+ x_abcdef = 5;
+ break; /* d -> f */
+ case 4:
+ x_abcdef = 3;
+ break; /* e -> d */
+ case 5:
+ x_abcdef = 1;
+ break; /* f -> b */
+ }
+
+ /* blue pixels */
+ vfd_table[x][y][0][display][0] =
+ (x >
+ 1) ? x_abcdef * 4 + ((x -
+ 1) / 3) *
+ 1024 + y * 48 +
+ display : x_abcdef * 4 + 0 +
+ y * 48 + display;
+ /* blue pixels */
+ if (x > 1 && (x - 1) % 3)
+ vfd_table[x][y][0][display][1] =
+ x_abcdef * 4 +
+ ((x - 1) / 3 + 1) * 1024 +
+ y * 48 + display;
+
+ /* red pixels */
+ vfd_table[x][y][1][display][0] =
+ (x >
+ 1) ? x_abcdef * 4 + 24 + ((x -
+ 1) /
+ 3) *
+ 1024 + y * 48 +
+ display : x_abcdef * 4 + 24 + 0 +
+ y * 48 + display;
+ /* red pixels */
+ if (x > 1 && (x - 1) % 3)
+ vfd_table[x][y][1][display][1] =
+ x_abcdef * 4 + 24 +
+ ((x - 1) / 3 + 1) * 1024 +
+ y * 48 + display;
+ }
+ }
}
- }
- break;
+ break;
default:
- /* do nothing */
- return;
+ /* do nothing */
+ return;
}
/*
@@ -243,31 +294,45 @@ void create_vfd_table(void)
* bit-number within the byte
* from table with bit-numbers within the total framebuffer
*/
- for(y=0;y<18;y++) {
- for(x=0;x<112;x++) {
- for(color=0;color<2;color++) {
- for(display=0;display<4;display++) {
- for(entry=0;entry<2;entry++) {
- unsigned long adr = gd->fb_base;
- unsigned int bit_nr = 0;
-
- pixel = vfd_table[x][y][color][display][entry] + frame_buf_offs;
- /*
- * wrap arround if offset
- * (see manual S3C2400)
- */
- if (pixel>=FRAME_BUF_SIZE*8)
- pixel = pixel-(FRAME_BUF_SIZE*8);
- adr = gd->fb_base+(pixel/32)*4+(3-(pixel%32)/8);
- bit_nr = pixel%8;
- bit_nr = (bit_nr>3)?bit_nr-4:bit_nr+4;
-
- adr_vfd_table[x][y][color][display][entry] = adr;
- bit_vfd_table[x][y][color][display][entry] = bit_nr;
+ for (y = 0; y < 18; y++) {
+ for (x = 0; x < 112; x++) {
+ for (color = 0; color < 2; color++) {
+ for (display = 0; display < 4; display++) {
+ for (entry = 0; entry < 2; entry++) {
+ unsigned long adr = gd->fb_base;
+ unsigned int bit_nr = 0;
+
+ pixel =
+ vfd_table[x][y][color]
+ [display][entry] +
+ frame_buf_offs;
+ /*
+ * wrap around if offset
+ * (see manual S3C2400)
+ */
+ if (pixel >=
+ FRAME_BUF_SIZE * 8)
+ pixel =
+ pixel -
+ (FRAME_BUF_SIZE * 8);
+ adr =
+ gd->fb_base +
+ (pixel / 32) * 4 +
+ (3 - (pixel % 32) / 8);
+ bit_nr = pixel % 8;
+ bit_nr =
+ (bit_nr >
+ 3) ? bit_nr - 4 : bit_nr +
+ 4;
+
+ adr_vfd_table[x][y][color]
+ [display][entry] = adr;
+ bit_vfd_table[x][y][color]
+ [display][entry] = bit_nr;
+ }
+ }
}
- }
}
- }
}
}
@@ -281,7 +346,7 @@ void set_vfd_pixel(unsigned char x, unsigned char y,
ulong adr;
unsigned char bit_nr, temp;
- if (! gd->vfd_type) {
+ if (!gd->vfd_type) {
/* Unknown type. */
return;
}
@@ -290,14 +355,14 @@ void set_vfd_pixel(unsigned char x, unsigned char y,
adr = adr_vfd_table[x][y][color][display][0];
/* Pixel-Eintrag Nr. 1 */
bit_nr = bit_vfd_table[x][y][color][display][0];
- temp=(*(volatile unsigned char*)(adr));
+ temp = (*(volatile unsigned char *)(adr));
if (value)
- temp |= (1<<bit_nr);
+ temp |= (1 << bit_nr);
else
- temp &= ~(1<<bit_nr);
+ temp &= ~(1 << bit_nr);
- (*(volatile unsigned char*)(adr))=temp;
+ (*(volatile unsigned char *)(adr)) = temp;
}
/*
@@ -308,38 +373,37 @@ void transfer_pic(int display, unsigned char *adr, int height, int width)
int x, y;
unsigned char temp;
- for (; height > 0; height -= 18)
- {
+ for (; height > 0; height -= 18) {
if (height > 18)
y = 18;
else
y = height;
- for (; y > 0; y--)
- {
- for (x = 0; x < width; x += 2)
- {
+ for (; y > 0; y--) {
+ for (x = 0; x < width; x += 2) {
temp = *adr++;
- set_vfd_pixel(x, y-1, 0, display, 0);
- set_vfd_pixel(x, y-1, 1, display, 0);
+ set_vfd_pixel(x, y - 1, 0, display, 0);
+ set_vfd_pixel(x, y - 1, 1, display, 0);
if ((temp >> 4) == BLAU)
- set_vfd_pixel(x, y-1, 0, display, 1);
+ set_vfd_pixel(x, y - 1, 0, display, 1);
else if ((temp >> 4) == ROT)
- set_vfd_pixel(x, y-1, 1, display, 1);
- else if ((temp >> 4) == VIOLETT)
- {
- set_vfd_pixel(x, y-1, 0, display, 1);
- set_vfd_pixel(x, y-1, 1, display, 1);
+ set_vfd_pixel(x, y - 1, 1, display, 1);
+ else if ((temp >> 4) == VIOLETT) {
+ set_vfd_pixel(x, y - 1, 0, display, 1);
+ set_vfd_pixel(x, y - 1, 1, display, 1);
}
- set_vfd_pixel(x+1, y-1, 0, display, 0);
- set_vfd_pixel(x+1, y-1, 1, display, 0);
+ set_vfd_pixel(x + 1, y - 1, 0, display, 0);
+ set_vfd_pixel(x + 1, y - 1, 1, display, 0);
if ((temp & 0x0F) == BLAU)
- set_vfd_pixel(x+1, y-1, 0, display, 1);
+ set_vfd_pixel(x + 1, y - 1, 0, display,
+ 1);
else if ((temp & 0x0F) == ROT)
- set_vfd_pixel(x+1, y-1, 1, display, 1);
- else if ((temp & 0x0F) == VIOLETT)
- {
- set_vfd_pixel(x+1, y-1, 0, display, 1);
- set_vfd_pixel(x+1, y-1, 1, display, 1);
+ set_vfd_pixel(x + 1, y - 1, 1, display,
+ 1);
+ else if ((temp & 0x0F) == VIOLETT) {
+ set_vfd_pixel(x + 1, y - 1, 0, display,
+ 1);
+ set_vfd_pixel(x + 1, y - 1, 1, display,
+ 1);
}
}
}
@@ -354,66 +418,73 @@ void transfer_pic(int display, unsigned char *adr, int height, int width)
* This function initializes VFD clock that is needed for the CPLD that
* manages the keyboard.
*/
-int vfd_init_clocks (void)
+int vfd_init_clocks(void)
{
int i;
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
- struct s3c24x0_timers * const timers = s3c24x0_get_base_timers();
- struct s3c24x0_lcd * const lcd = s3c24x0_get_base_lcd();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_timers *const timers = s3c24x0_get_base_timers();
+ struct s3c24x0_lcd *const lcd = s3c24x0_get_base_lcd();
/* try to determine display type from the value
* defined by pull-ups
*/
- gpio->PCUP = (gpio->PCUP & 0xFFF0); /* activate GPC0...GPC3 pullups */
- gpio->PCCON = (gpio->PCCON & 0xFFFFFF00); /* configure GPC0...GPC3 as inputs */
+ /* activate GPC0...GPC3 pullups */
+ writel(readl(&gpio->pcup) & 0xFFF0, &gpio->pcup);
+ /* configure GPC0...GPC3 as inputs */
+ writel(readl(&gpio->pccon) & 0xFFFFFF00, &gpio->pccon);
/* allow signals to settle */
- for (i=0; i<10000; i++) /* udelay isn't working yet at this point! */
+ /* udelay isn't working yet at this point! */
+ for (i = 0; i < 10000; i++)
__asm__("NOP");
- vfd_board_id = (~gpio->PCDAT) & 0x000F; /* read GPC0...GPC3 port pins */
+ /* read GPC0...GPC3 port pins */
+ vfd_board_id = (~readl(&gpio->pcdat)) & 0x000F;
- VFD_DISABLE; /* activate blank for the vfd */
+ VFD_DISABLE; /* activate blank for the vfd */
#define NEW_CPLD_CLK
#ifdef NEW_CPLD_CLK
if (vfd_board_id) {
/* If new board revision, then use PWM 3 as cpld-clock */
- /* Enable 500 Hz timer for fill level sensor to operate properly */
+ /* Enable 500 Hz timer for fill level sensor
+ to operate properly */
/* Configure TOUT3 as functional pin, disable pull-up */
- gpio->PDCON &= ~0x30000;
- gpio->PDCON |= 0x20000;
- gpio->PDUP |= (1 << 8);
+ writel(readl(&gpio->pdcon) & ~0x30000, &gpio->pdcon);
+ writel(readl(&gpio->pdcon) | 0x20000, &gpio->pdcon);
+ writel(readl(&gpio->pdup) | (1 << 8), &gpio->pdup);
/* Configure the prescaler */
- timers->TCFG0 &= ~0xff00;
- timers->TCFG0 |= 0x0f00;
+ writel(readl(&timers->tcfg0) & ~0xff00, &timers->tcfg0);
+ writel(readl(&timers->tcfg0) | 0x0f00, &timers->tcfg0);
/* Select MUX input (divider) for timer3 (1/16) */
- timers->TCFG1 &= ~0xf000;
- timers->TCFG1 |= 0x3000;
+ writel(readl(&timers->tcfg1) & ~0xf000, &timers->tcfg1);
+ writel(readl(&timers->tcfg1) | 0x3000, &timers->tcfg1);
/* Enable autoreload and set the counter and compare
* registers to values for the 500 Hz clock
* (for a given prescaler (15) and divider (16)):
* counter = (66000000 / 500) >> 9;
*/
- timers->ch[3].TCNTB = 0x101;
- timers->ch[3].TCMPB = 0x101 / 2;
+ writel(0x101, &timers->ch[3].tcntb);
+ writel(0x101 / 2, &timers->ch[3].tcmpb);
/* Start timer */
- timers->TCON = (timers->TCON | UPDATE3 | RELOAD3) & ~INVERT3;
- timers->TCON = (timers->TCON | START3) & ~UPDATE3;
+ writel((readl(&timers->tcon) | UPDATE3 | RELOAD3) & ~INVERT3,
+ &timers->tcon);
+ writel((readl(&timers->tcon) | START3) & ~UPDATE3,
+ &timers->tcon);
}
#endif
/* If old board revision, then use vm-signal as cpld-clock */
- lcd->LCDCON2 = 0x00FFC000;
- lcd->LCDCON3 = 0x0007FF00;
- lcd->LCDCON4 = 0x00000000;
- lcd->LCDCON5 = 0x00000400;
- lcd->LCDCON1 = 0x00000B75;
+ writel(0x00FFC000, &lcd->lcdcon2);
+ writel(0x0007FF00, &lcd->lcdcon3);
+ writel(0x00000000, &lcd->lcdcon4);
+ writel(0x00000400, &lcd->lcdcon5);
+ writel(0x00000B75, &lcd->lcdcon1);
/* VM (GPD1) is used as clock for the CPLD */
- gpio->PDCON = (gpio->PDCON & 0xFFFFFFF3) | 0x00000008;
+ writel((readl(&gpio->pdcon) & 0xFFFFFFF3) | 0x00000008, &gpio->pdcon);
return 0;
}
@@ -429,8 +500,8 @@ int vfd_init_clocks (void)
*/
int drv_vfd_init(void)
{
- struct s3c24x0_lcd * const lcd = s3c24x0_get_base_lcd();
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_lcd *const lcd = s3c24x0_get_base_lcd();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
char *tmp;
ulong palette;
static int vfd_init_done = 0;
@@ -443,8 +514,8 @@ int drv_vfd_init(void)
debug("Detecting Revison of WA4-VFD: ID=0x%X\n", vfd_board_id);
switch (vfd_board_id) {
- case 0: /* board revision < Rev.200 */
- if ((tmp = getenv ("vfd_type")) == NULL) {
+ case 0: /* board revision < Rev.200 */
+ if ((tmp = getenv("vfd_type")) == NULL) {
break;
}
if (strcmp(tmp, "T119C") == 0) {
@@ -460,22 +531,21 @@ int drv_vfd_init(void)
default: /* default to MN11236, data inverted */
gd->vfd_type = VFD_TYPE_MN11236;
vfd_inv_data = 1;
- setenv ("vfd_type", "MN11236");
+ setenv("vfd_type", "MN11236");
}
- debug ("VFD type: %s%s\n",
- (gd->vfd_type == VFD_TYPE_T119C) ? "T119C" :
- (gd->vfd_type == VFD_TYPE_MN11236) ? "MN11236" :
- "unknown",
- vfd_inv_data ? ", inverted data" : "");
+ debug("VFD type: %s%s\n",
+ (gd->vfd_type == VFD_TYPE_T119C) ? "T119C" :
+ (gd->vfd_type == VFD_TYPE_MN11236) ? "MN11236" :
+ "unknown", vfd_inv_data ? ", inverted data" : "");
gd->fb_base = gd->fb_base;
create_vfd_table();
init_grid_ctrl();
- for (palette=0; palette < 16; palette++)
- (*(volatile unsigned int*)(PALETTE+(palette*4)))=palette;
- for (palette=16; palette < 256; palette++)
- (*(volatile unsigned int*)(PALETTE+(palette*4)))=0x00;
+ for (palette = 0; palette < 16; palette++)
+ (*(volatile unsigned int *)(PALETTE + (palette * 4))) = palette;
+ for (palette = 16; palette < 256; palette++)
+ (*(volatile unsigned int *)(PALETTE + (palette * 4))) = 0x00;
/*
* Hinweis: Der Framebuffer ist um genau ein Nibble verschoben
@@ -485,40 +555,43 @@ int drv_vfd_init(void)
* see manual S3C2400
*/
/* Stopp LCD-Controller */
- lcd->LCDCON1 = 0x00000000;
+ writel(0x00000000, &lcd->lcdcon1);
/* frame buffer startadr */
- lcd->LCDSADDR1 = gd->fb_base >> 1;
+ writel(gd->fb_base >> 1, &lcd->lcdsaddr1);
/* frame buffer endadr */
- lcd->LCDSADDR2 = (gd->fb_base + FRAME_BUF_SIZE) >> 1;
- lcd->LCDSADDR3 = ((256/4));
- lcd->LCDCON2 = 0x000DC000;
- if(gd->vfd_type == VFD_TYPE_MN11236)
- lcd->LCDCON2 = 37 << 14; /* MN11236: 38 lines */
+ writel((gd->fb_base + FRAME_BUF_SIZE) >> 1, &lcd->lcdsaddr2);
+ writel(256 / 4, &lcd->lcdsaddr3);
+ writel(0x000DC000, &lcd->lcdcon2);
+ if (gd->vfd_type == VFD_TYPE_MN11236)
+ writel(37 << 14, &lcd->lcdcon2); /* MN11236: 38 lines */
else
- lcd->LCDCON2 = 55 << 14; /* T119C: 56 lines */
- lcd->LCDCON3 = 0x0051000A;
- lcd->LCDCON4 = 0x00000001;
+ writel(55 << 14, &lcd->lcdcon2); /* T119C: 56 lines */
+ writel(0x0051000A, &lcd->lcdcon3);
+ writel(0x00000001, &lcd->lcdcon4);
if (gd->vfd_type && vfd_inv_data)
- lcd->LCDCON5 = 0x000004C0;
+ writel(0x000004C0, &lcd->lcdcon5);
else
- lcd->LCDCON5 = 0x00000440;
+ writel(0x00000440, &lcd->lcdcon5);
/* Port pins as LCD output */
- gpio->PCCON = (gpio->PCCON & 0xFFFFFF00)| 0x000000AA;
- gpio->PDCON = (gpio->PDCON & 0xFFFFFF03)| 0x000000A8;
-
- /* Synchronize VFD enable with LCD controller to avoid flicker */
- lcd->LCDCON1 = 0x00000B75; /* Start LCD-Controller */
- while((lcd->LCDCON5 & 0x180000)!=0x100000); /* Wait for end of VSYNC */
- while((lcd->LCDCON5 & 0x060000)!=0x040000); /* Wait for next HSYNC */
- while((lcd->LCDCON5 & 0x060000)==0x040000);
- while((lcd->LCDCON5 & 0x060000)!=0x000000);
- if(gd->vfd_type)
+ writel((readl(&gpio->pccon) & 0xFFFFFF00) | 0x000000AA, &gpio->pccon);
+ writel((readl(&gpio->pdcon) & 0xFFFFFF03) | 0x000000A8, &gpio->pdcon);
+
+ /* Synchronize VFD enable with LCD controller to avoid flicker */
+ /* Start LCD-Controller */
+ writel(0x00000B75, &lcd->lcdcon1);
+ /* Wait for end of VSYNC */
+ while ((readl(&lcd->lcdcon5) & 0x180000) != 0x100000) ;
+ /* Wait for next HSYNC */
+ while ((readl(&lcd->lcdcon5) & 0x060000) != 0x040000) ;
+ while ((readl(&lcd->lcdcon5) & 0x060000) == 0x040000) ;
+ while ((readl(&lcd->lcdcon5) & 0x060000) != 0x000000) ;
+ if (gd->vfd_type)
VFD_ENABLE;
- debug ("LCDSADDR1: %lX\n", lcd->LCDSADDR1);
- debug ("LCDSADDR2: %lX\n", lcd->LCDSADDR2);
- debug ("LCDSADDR3: %lX\n", lcd->LCDSADDR3);
+ debug("LCDSADDR1: %lX\n", readl(&lcd->lcdsaddr1));
+ debug("LCDSADDR2: %lX\n", readl(&lcd->lcdsaddr2));
+ debug("LCDSADDR3: %lX\n", readl(&lcd->lcdsaddr3));
return 0;
}
@@ -527,13 +600,13 @@ int drv_vfd_init(void)
* Disable VFD: should be run before resetting the system:
* disable VM, enable pull-up
*/
-void disable_vfd (void)
+void disable_vfd(void)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
VFD_DISABLE;
- gpio->PDCON &= ~0xC;
- gpio->PDUP &= ~0x2;
+ writel(readl(&gpio->pdcon) & ~0xC, &gpio->pdcon);
+ writel(readl(&gpio->pdup) & ~0x2, &gpio->pdup);
}
/************************************************************************/
@@ -546,14 +619,15 @@ void disable_vfd (void)
*
* Note that this is running from ROM, so no write access to global data.
*/
-ulong vfd_setmem (ulong addr)
+ulong vfd_setmem(ulong addr)
{
ulong size;
/* Round up to nearest full page */
size = (FRAME_BUF_SIZE + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
- debug ("Reserving %ldk for VFD Framebuffer at: %08lx\n", size>>10, addr);
+ debug("Reserving %ldk for VFD Framebuffer at: %08lx\n", size >> 10,
+ addr);
return (size);
}
@@ -562,7 +636,7 @@ ulong vfd_setmem (ulong addr)
* Calculate fb size for VIDEOLFB_ATAG. Size returned contains fb,
* descriptors and palette areas.
*/
-ulong calc_fbsize (void)
+ulong calc_fbsize(void)
{
return FRAME_BUF_SIZE;
}
--
1.6.1.2
2
3

15 Dec '09
Hi,
I'm running latest u-boot on 1GHz Canyonlands board and have trouble
using 64-bit transparent PCI-PCI PLX 6254 bridge. With PLX evaluation
board plugged into Canyonlands PCI slot u-boot hangs. With PCI support
disabled u-boot works fine. The PLX board is OK, it was recognized by
both u-boot and kernel on Freescale MPC8536DS board. On Canyonlands
linux-2.6.32 silently resets the board when PLX is plugged in. Any ideas
what could be wrong in u-boot ? I'll post a separate question to
linuxppc-dev.
U-Boot 2009.11-rc2-00002-g386118a (Dec 09 2009 - 18:48:44)
CPU: AMCC PowerPC 460EX Rev. A at 1000 MHz (PLB=200 OPB=100 EBC=100)
Security/Kasumi support
Bootstrap Option H - Boot ROM Location I2C (Addr 0x52)
Internal PCI arbiter enabled
32 kB I-Cache 32 kB D-Cache
Board: Canyonlands - AMCC PPC460EX Evaluation Board, 2*PCIe, Rev. 14
I2C: ready
DRAM: 512 MB (ECC not enabled, 400 MHz, CL3)
FLASH: 64 MB
NAND: 256 MiB
PCI: Bus Dev VenId DevId Class Int
Thanks a lot.
Felix.
4
10

[U-Boot] [PATCH ARM 2/3] s3c24x0 code style changes
by kevin.morfitt@fearnside-systems.co.uk 15 Dec '09
by kevin.morfitt@fearnside-systems.co.uk 15 Dec '09
15 Dec '09
Cleans up the s3c24x0 header files by changing the upper case members
of the s3c24x0 register structures to lower case and changing all code
that uses these register structures.
Signed-off-by: Kevin Morfitt <kevin.morfitt(a)fearnside-systems.co.uk>
---
board/mpl/vcma9/vcma9.c | 264 ++++++++++---------
board/mpl/vcma9/vcma9.h | 91 +++---
board/samsung/smdk2400/smdk2400.c | 53 ++--
board/samsung/smdk2410/smdk2410.c | 85 +++---
board/sbc2410x/sbc2410x.c | 131 +++++-----
board/trab/cmd_trab.c | 547 +++++++++++++++++-------------------
board/trab/rs485.c | 92 ++++---
7 files changed, 626 insertions(+), 637 deletions(-)
diff --git a/board/mpl/vcma9/vcma9.c b/board/mpl/vcma9/vcma9.c
index 1835677..84338eb 100644
--- a/board/mpl/vcma9/vcma9.c
+++ b/board/mpl/vcma9/vcma9.c
@@ -39,32 +39,31 @@ DECLARE_GLOBAL_DATA_PTR;
#define FCLK_SPEED 1
#if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */
-#define M_MDIV 0xC3
-#define M_PDIV 0x4
-#define M_SDIV 0x1
+ #define M_MDIV 0xC3
+ #define M_PDIV 0x4
+ #define M_SDIV 0x1
#elif FCLK_SPEED==1 /* Fout = 202.8MHz */
-#define M_MDIV 0xA1
-#define M_PDIV 0x3
-#define M_SDIV 0x1
+ #define M_MDIV 0xA1
+ #define M_PDIV 0x3
+ #define M_SDIV 0x1
#endif
#define USB_CLOCK 1
#if USB_CLOCK==0
-#define U_M_MDIV 0xA1
-#define U_M_PDIV 0x3
-#define U_M_SDIV 0x1
+ #define U_M_MDIV 0xA1
+ #define U_M_PDIV 0x3
+ #define U_M_SDIV 0x1
#elif USB_CLOCK==1
-#define U_M_MDIV 0x48
-#define U_M_PDIV 0x3
-#define U_M_SDIV 0x2
+ #define U_M_MDIV 0x48
+ #define U_M_PDIV 0x3
+ #define U_M_SDIV 0x2
#endif
static inline void delay(unsigned long loops)
{
- __asm__ volatile ("1:\n"
- "subs %0, %1, #1\n"
- "bne 1b":"=r" (loops):"0" (loops));
+ __asm__ volatile("1:\n"
+ "subs %0, %1, #1\n" "bne 1b":"=r" (loops):"0"(loops));
}
/*
@@ -73,47 +72,48 @@ static inline void delay(unsigned long loops)
int board_init(void)
{
- struct s3c24x0_clock_power * const clk_power =
- s3c24x0_get_base_clock_power();
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_clock_power *const clk_power =
+ s3c24x0_get_base_clock_power();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* to reduce PLL lock time, adjust the LOCKTIME register */
- clk_power->LOCKTIME = 0xFFFFFF;
+ writel(0xFFFFFF, &clk_power->locktime);
/* configure MPLL */
- clk_power->MPLLCON = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
+ writel((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV, &clk_power->mpllcon);
/* some delay between MPLL and UPLL */
- delay (4000);
+ delay(4000);
/* configure UPLL */
- clk_power->UPLLCON = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);
+ writel((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV, &clk_power->upllcon);
/* some delay between MPLL and UPLL */
- delay (8000);
+ delay(8000);
/* set up the I/O ports */
- gpio->GPACON = 0x007FFFFF;
- gpio->GPBCON = 0x002AAAAA;
- gpio->GPBUP = 0x000002BF;
- gpio->GPCCON = 0xAAAAAAAA;
- gpio->GPCUP = 0x0000FFFF;
- gpio->GPDCON = 0xAAAAAAAA;
- gpio->GPDUP = 0x0000FFFF;
- gpio->GPECON = 0xAAAAAAAA;
- gpio->GPEUP = 0x000037F7;
- gpio->GPFCON = 0x00000000;
- gpio->GPFUP = 0x00000000;
- gpio->GPGCON = 0xFFEAFF5A;
- gpio->GPGUP = 0x0000F0DC;
- gpio->GPHCON = 0x0028AAAA;
- gpio->GPHUP = 0x00000656;
+ writel(0x007FFFFF, &gpio->gpacon);
+ writel(0x002AAAAA, &gpio->gpbcon);
+ writel(0x000002BF, &gpio->gpbup);
+ writel(0xAAAAAAAA, &gpio->gpccon);
+ writel(0x0000FFFF, &gpio->gpcup);
+ writel(0xAAAAAAAA, &gpio->gpdcon);
+ writel(0x0000FFFF, &gpio->gpdup);
+ writel(0xAAAAAAAA, &gpio->gpecon);
+ writel(0x000037F7, &gpio->gpeup);
+ writel(0x00000000, &gpio->gpfcon);
+ writel(0x00000000, &gpio->gpfup);
+ writel(0xFFEAFF5A, &gpio->gpgcon);
+ writel(0x0000F0DC, &gpio->gpgup);
+ writel(0x0028AAAA, &gpio->gphcon);
+ writel(0x00000656, &gpio->gphup);
/* setup correct IRQ modes for NIC */
- gpio->EXTINT2 = (gpio->EXTINT2 & ~(7<<8)) | (4<<8); /* rising edge mode */
+ /* rising edge mode */
+ writel((readl(&gpio->extint2) & ~(7 << 8)) | (4 << 8), &gpio->extint2);
/* select USB port 2 to be host or device (fix to host for now) */
- gpio->MISCCR |= 0x08;
+ writel(readl(&gpio->misccr) | 0x08, &gpio->misccr);
/* init serial */
gd->baudrate = CONFIG_BAUDRATE;
@@ -136,52 +136,49 @@ int board_init(void)
* NAND flash initialization.
*/
#if defined(CONFIG_CMD_NAND)
-extern ulong
-nand_probe(ulong physadr);
-
+extern ulong nand_probe(ulong physadr);
static inline void NF_Reset(void)
{
- int i;
+ int i;
- NF_SetCE(NFCE_LOW);
- NF_Cmd(0xFF); /* reset command */
- for(i = 0; i < 10; i++); /* tWB = 100ns. */
- NF_WaitRB(); /* wait 200~500us; */
- NF_SetCE(NFCE_HIGH);
+ nf_setce(NFCE_LOW);
+ nf_cmd(0xFF); /* reset command */
+ for (i = 0; i < 10; i++) ; /* tWB = 100ns. */
+ nf_waitrb(); /* wait 200~500us; */
+ nf_setce(NFCE_HIGH);
}
-
-static inline void NF_Init(void)
+static inline void nf_init(void)
{
-#if 0 /* a little bit too optimistic */
-#define TACLS 0
-#define TWRPH0 3
-#define TWRPH1 0
+#if 0 /* a little bit too optimistic */
+ #define TACLS 0
+ #define TWRPH0 3
+ #define TWRPH1 0
#else
-#define TACLS 0
-#define TWRPH0 4
-#define TWRPH1 2
+ #define TACLS 0
+ #define TWRPH0 4
+ #define TWRPH1 2
#endif
- NF_Conf((1<<15)|(0<<14)|(0<<13)|(1<<12)|(1<<11)|(TACLS<<8)|(TWRPH0<<4)|(TWRPH1<<0));
- /*nand->NFCONF = (1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<11)|(TACLS<<8)|(TWRPH0<<4)|(TWRPH1<<0); */
- /* 1 1 1 1, 1 xxx, r xxx, r xxx */
- /* En 512B 4step ECCR nFCE=H tACLS tWRPH0 tWRPH1 */
+ nf_conf((1 << 15) | (0 << 14) | (0 << 13) | (1 << 12) | (1 << 11) |
+ (TACLS << 8) | (TWRPH0 << 4) | (TWRPH1 << 0));
+ /*nand->NFCONF = (1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<11)|(TACLS<<8)|(TWRPH0<<4)|(TWRPH1<<0); */
+ /* 1 1 1 1, 1 xxx, r xxx, r xxx */
+ /* En 512B 4step ECCR nFCE=H tACLS tWRPH0 tWRPH1 */
- NF_Reset();
+ nf_reset();
}
-void
-nand_init(void)
+void nand_init(void)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- NF_Init();
+ nf_init();
#ifdef DEBUG
- printf("NAND flash probing at 0x%.8lX\n", (ulong)nand);
+ printf("NAND flash probing at 0x%.8lX\n", (ulong) nand);
#endif
- printf ("%4lu MB\n", nand_probe((ulong)nand) >> 20);
+ printf("%4lu MB\n", nand_probe((ulong) nand) >> 20);
}
#endif
@@ -189,96 +186,112 @@ nand_init(void)
* Get some Board/PLD Info
*/
-static u8 Get_PLD_ID(void)
+static u8 get_pld_id(void)
{
- VCMA9_PLD * const pld = VCMA9_get_base_PLD();
+ vcma9_pld *const pld = vcma9_get_base_pld();
- return(pld->ID);
+ return readl(&pld->id);
}
-static u8 Get_PLD_BOARD(void)
+static u8 get_pld_board(void)
{
- VCMA9_PLD * const pld = VCMA9_get_base_PLD();
+ vcma9_pld *const pld = vcma9_get_base_pld();
- return(pld->BOARD);
+ return readl(&pld->board);
}
-static u8 Get_PLD_SDRAM(void)
+static u8 get_pld_sdram(void)
{
- VCMA9_PLD * const pld = VCMA9_get_base_PLD();
+ vcma9_pld *const pld = vcma9_get_base_pld();
- return(pld->SDRAM);
+ return readl(&pld->sdram);
}
-static u8 Get_PLD_Version(void)
+static u8 get_pld_version(void)
{
- return((Get_PLD_ID() >> 4) & 0x0F);
+ return ((get_pld_id() >> 4) & 0x0F);
}
-static u8 Get_PLD_Revision(void)
+static u8 get_pld_revision(void)
{
- return(Get_PLD_ID() & 0x0F);
+ return (get_pld_id() & 0x0F);
}
-#if 0 /* not used */
-static int Get_Board_Config(void)
+#if 0 /* not used */
+static int get_board_config(void)
{
- u8 config = Get_PLD_BOARD() & 0x03;
+ u8 config = get_pld_board() & 0x03;
if (config == 3)
- return 1;
+ return 1;
else
- return 0;
+ return 0;
}
#endif
-static uchar Get_Board_PCB(void)
+static uchar get_board_pcb(void)
{
- return(((Get_PLD_BOARD() >> 4) & 0x03) + 'A');
+ return (((get_pld_board() >> 4) & 0x03) + 'A');
}
-static u8 Get_SDRAM_ChipNr(void)
+static u8 get_sdram_chipnr(void)
{
- switch ((Get_PLD_SDRAM() >> 4) & 0x0F) {
- case 0: return 4;
- case 1: return 1;
- case 2: return 2;
- default: return 0;
+ switch ((get_pld_sdram() >> 4) & 0x0F) {
+ case 0:
+ return 4;
+ case 1:
+ return 1;
+ case 2:
+ return 2;
+ default:
+ return 0;
}
}
-static ulong Get_SDRAM_ChipSize(void)
+static ulong get_sdram_chipsize(void)
{
- switch (Get_PLD_SDRAM() & 0x0F) {
- case 0: return 16 * (1024*1024);
- case 1: return 32 * (1024*1024);
- case 2: return 8 * (1024*1024);
- case 3: return 8 * (1024*1024);
- default: return 0;
+ switch (get_pld_sdram() & 0x0F) {
+ case 0:
+ return 16 * (1024 * 1024);
+ case 1:
+ return 32 * (1024 * 1024);
+ case 2:
+ return 8 * (1024 * 1024);
+ case 3:
+ return 8 * (1024 * 1024);
+ default:
+ return 0;
}
}
-static const char * Get_SDRAM_ChipGeom(void)
+static const char *get_sdram_chipgeom(void)
{
- switch (Get_PLD_SDRAM() & 0x0F) {
- case 0: return "4Mx8x4";
- case 1: return "8Mx8x4";
- case 2: return "2Mx8x4";
- case 3: return "4Mx8x2";
- default: return "unknown";
+ switch (get_pld_sdram() & 0x0F) {
+ case 0:
+ return "4Mx8x4";
+ case 1:
+ return "8Mx8x4";
+ case 2:
+ return "2Mx8x4";
+ case 3:
+ return "4Mx8x2";
+ default:
+ return "unknown";
}
}
-static void Show_VCMA9_Info(char *board_name, char *serial)
+static void show_vcma9_info(char *board_name, char *serial)
{
printf("Board: %s SN: %s PCB Rev: %c PLD(%d,%d)\n",
- board_name, serial, Get_Board_PCB(), Get_PLD_Version(), Get_PLD_Revision());
- printf("SDRAM: %d chips %s\n", Get_SDRAM_ChipNr(), Get_SDRAM_ChipGeom());
+ board_name, serial, get_board_pcb(), get_pld_version(),
+ get_pld_revision());
+ printf("SDRAM: %d chips %s\n", get_sdram_chipnr(),
+ get_sdram_chipgeom());
}
int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
- gd->bd->bi_dram[0].size = Get_SDRAM_ChipSize() * Get_SDRAM_ChipNr();
+ gd->bd->bi_dram[0].size = get_sdram_chipsize() * get_sdram_chipnr();
return 0;
}
@@ -296,23 +309,22 @@ int checkboard(void)
backup_t *b = (backup_t *) s;
i = getenv_r("serial#", s, 32);
- if ((i < 0) || strncmp (s, "VCMA9", 5)) {
- get_backup_values (b);
- if (strncmp (b->signature, "MPL\0", 4) != 0) {
- puts ("### No HW ID - assuming VCMA9");
+ if ((i < 0) || strncmp(s, "VCMA9", 5)) {
+ get_backup_values(b);
+ if (strncmp(b->signature, "MPL\0", 4) != 0) {
+ puts("### No HW ID - assuming VCMA9");
} else {
b->serial_name[5] = 0;
- Show_VCMA9_Info(b->serial_name, &b->serial_name[6]);
+ show_vcma9_info(b->serial_name, &b->serial_name[6]);
}
} else {
s[5] = 0;
- Show_VCMA9_Info(s, &s[6]);
+ show_vcma9_info(s, &s[6]);
}
- /*printf("\n");*/
- return(0);
+ /*printf("\n"); */
+ return (0);
}
-
int last_stage_init(void)
{
checkboard();
@@ -341,16 +353,16 @@ void print_vcma9_info(void)
int i;
if ((i = getenv_r("serial#", s, 32)) < 0) {
- puts ("### No HW ID - assuming VCMA9");
- printf("i %d", i*24);
+ puts("### No HW ID - assuming VCMA9");
+ printf("i %d", i * 24);
} else {
s[5] = 0;
- Show_VCMA9_Info(s, &s[6]);
+ show_vcma9_info(s, &s[6]);
}
}
#ifdef CONFIG_CMD_NET
-int board_eth_init(bd_t *bis)
+int board_eth_init(bd_t * bis)
{
int rc = 0;
#ifdef CONFIG_CS8900
diff --git a/board/mpl/vcma9/vcma9.h b/board/mpl/vcma9/vcma9.h
index 94fd2fa..1f5c9b5 100644
--- a/board/mpl/vcma9/vcma9.h
+++ b/board/mpl/vcma9/vcma9.h
@@ -26,8 +26,9 @@
*****************************************************************************/
#include <asm/arch/s3c24x0_cpu.h>
+#include <asm/io.h>
-extern int mem_test(unsigned long start, unsigned long ramsize,int mode);
+extern int mem_test(unsigned long start, unsigned long ramsize, int mode);
void print_vcma9_info(void);
@@ -37,98 +38,98 @@ typedef enum {
NFCE_HIGH
} NFCE_STATE;
-static inline void NF_Conf(u16 conf)
+static inline void nf_conf(u16 conf)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- nand->NFCONF = conf;
+ writel(conf, &nand->nfconf);
}
-static inline void NF_Cmd(u8 cmd)
+static inline void nf_cmd(u8 cmd)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- nand->NFCMD = cmd;
+ writel(cmd, &nand->nfcmd);
}
-static inline void NF_CmdW(u8 cmd)
+static inline void nf_cmdw(u8 cmd)
{
- NF_Cmd(cmd);
+ nf_cmd(cmd);
udelay(1);
}
-static inline void NF_Addr(u8 addr)
+static inline void nf_addr(u8 addr)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- nand->NFADDR = addr;
+ writel(addr, &nand->nfaddr);
}
-static inline void NF_SetCE(NFCE_STATE s)
+static inline void nf_setce(NFCE_STATE s)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
switch (s) {
- case NFCE_LOW:
- nand->NFCONF &= ~(1<<11);
- break;
+ case NFCE_LOW:
+ writel(readl(&nand->nfconf) & ~(1 << 11), &nand->nfconf);
+ break;
- case NFCE_HIGH:
- nand->NFCONF |= (1<<11);
- break;
+ case NFCE_HIGH:
+ writel(readl(&nand->nfconf) | (1 << 11), &nand->nfconf);
+ break;
}
}
-static inline void NF_WaitRB(void)
+static inline void nf_waitrb(void)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- while (!(nand->NFSTAT & (1<<0)));
+ while (!(readl(&nand->nfstat) & (1 << 0)));
}
-static inline void NF_Write(u8 data)
+static inline void nf_write(u8 data)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- nand->NFDATA = data;
+ writel(data, &nand->nfdata);
}
-static inline u8 NF_Read(void)
+static inline u8 nf_read(void)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- return(nand->NFDATA);
+ return readl(&nand->nfdata);
}
-static inline void NF_Init_ECC(void)
+static inline void nf_init_ecc(void)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- nand->NFCONF |= (1<<12);
+ writel(readl(&nand->nfconf) | (1 << 12), &nand->nfconf);
}
-static inline u32 NF_Read_ECC(void)
+static inline u32 nf_read_ecc(void)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- return(nand->NFECC);
+ return readl(&nand->nfecc);
}
#endif
/* VCMA9 PLD regsiters */
typedef struct {
- u8 ID;
- u8 NIC;
- u8 CAN;
- u8 MISC;
- u8 GPCD;
- u8 BOARD;
- u8 SDRAM;
-} /*__attribute__((__packed__))*/ VCMA9_PLD;
+ u8 id;
+ u8 nic;
+ u8 can;
+ u8 misc;
+ u8 gpcd;
+ u8 board;
+ u8 sdram;
+} /*__attribute__((__packed__))*/ vcma9_pld;
#define VCMA9_PLD_BASE 0x2C000100
-static inline VCMA9_PLD *VCMA9_get_base_PLD(void)
+static inline vcma9_pld *vcma9_get_base_pld(void)
{
- return (VCMA9_PLD * const)VCMA9_PLD_BASE;
+ return (vcma9_pld * const)VCMA9_PLD_BASE;
}
diff --git a/board/samsung/smdk2400/smdk2400.c b/board/samsung/smdk2400/smdk2400.c
index 1294d3f..51cfb7f 100644
--- a/board/samsung/smdk2400/smdk2400.c
+++ b/board/samsung/smdk2400/smdk2400.c
@@ -28,54 +28,55 @@
#include <common.h>
#include <netdev.h>
#include <asm/arch/s3c24x0_cpu.h>
+#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
#ifdef CONFIG_MODEM_SUPPORT
static int key_pressed(void);
-int mdm_init (bd_t *);
+int mdm_init(bd_t *);
extern void disable_putc(void);
extern void enable_putc(void);
extern int hwflow_onoff(int);
-extern int do_mdm_init; /* defined in common/main.c */
+extern int do_mdm_init; /* defined in common/main.c */
#endif /* CONFIG_MODEM_SUPPORT */
/*
* Miscellaneous platform dependent initialisations
*/
-int board_init (void)
+int board_init(void)
{
- struct s3c24x0_clock_power * const clk_power =
- s3c24x0_get_base_clock_power();
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_clock_power *const clk_power =
+ s3c24x0_get_base_clock_power();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* memory and cpu-speed are setup before relocation */
/* change the clock to be 50 MHz 1:1:1 */
- clk_power->MPLLCON = 0x5c042;
- clk_power->CLKDIVN = 0;
+ writel(0x5c042, &clk_power->mpllcon);
+ writel(0, &clk_power->clkdivn);
/* set up the I/O ports */
- gpio->PACON = 0x3ffff;
- gpio->PBCON = 0xaaaaaaaa;
- gpio->PBUP = 0xffff;
- gpio->PECON = 0x0;
- gpio->PEUP = 0x0;
+ writel(0x3ffff, &gpio->pacon);
+ writel(0xaaaaaaaa, &gpio->pbcon);
+ writel(0xffff, &gpio->pbup);
+ writel(0x0, &gpio->pecon);
+ writel(0x0, &gpio->peup);
#ifdef CONFIG_HWFLOW
/*CTS[0] RTS[0] INPUT INPUT TXD[0] INPUT RXD[0] */
/* 10, 10, 00, 00, 10, 00, 10 */
- gpio->PFCON=0xa22;
+ writel(0xa22, &gpio->pfcon);
/* Disable pull-up on Rx, Tx, CTS and RTS pins */
- gpio->PFUP=0x35;
+ writel(0x35, &gpio->pfup);
#else
/*INPUT INPUT INPUT INPUT TXD[0] INPUT RXD[0] */
/* 00, 00, 00, 00, 10, 00, 10 */
- gpio->PFCON = 0x22;
+ writel(0x22, &gpio->pfcon);
/* Disable pull-up on Rx and Tx pins */
- gpio->PFUP = 0x5;
-#endif /* CONFIG_HWFLOW */
- gpio->PGCON = 0x0;
- gpio->PGUP = 0x0;
- gpio->OPENCR = 0x0;
+ writel(0x5, &gpio->pfup);
+#endif /* CONFIG_HWFLOW */
+ writel(0x0, &gpio->pgcon);
+ writel(0x0, &gpio->pgup);
+ writel(0x0, &gpio->opencr);
/* arch number of SAMSUNG-Board to MACH_TYPE_SMDK2400 */
gd->bd->bi_arch_number = MACH_TYPE_SMDK2400;
@@ -88,12 +89,12 @@ int board_init (void)
disable_putc(); /* modem doesn't understand banner etc */
do_mdm_init = 1;
}
-#endif /* CONFIG_MODEM_SUPPORT */
+#endif /* CONFIG_MODEM_SUPPORT */
return 0;
}
-int dram_init (void)
+int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
@@ -105,16 +106,16 @@ int dram_init (void)
static int key_pressed(void)
{
int rc;
- if (1) { /* check for button push here, now just return 1 */
+ if (1) { /* check for button push here, now just return 1 */
rc = 1;
}
return rc;
}
-#endif /* CONFIG_MODEM_SUPPORT */
+#endif /* CONFIG_MODEM_SUPPORT */
#ifdef CONFIG_CMD_NET
-int board_eth_init(bd_t *bis)
+int board_eth_init(bd_t * bis)
{
int rc = 0;
#ifdef CONFIG_CS8900
diff --git a/board/samsung/smdk2410/smdk2410.c b/board/samsung/smdk2410/smdk2410.c
index 5d1a8bb..b8fdfcb 100644
--- a/board/samsung/smdk2410/smdk2410.c
+++ b/board/samsung/smdk2410/smdk2410.c
@@ -28,81 +28,82 @@
#include <common.h>
#include <netdev.h>
#include <asm/arch/s3c24x0_cpu.h>
+#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
#define FCLK_SPEED 1
#if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */
-#define M_MDIV 0xC3
-#define M_PDIV 0x4
-#define M_SDIV 0x1
+ #define M_MDIV 0xC3
+ #define M_PDIV 0x4
+ #define M_SDIV 0x1
#elif FCLK_SPEED==1 /* Fout = 202.8MHz */
-#define M_MDIV 0xA1
-#define M_PDIV 0x3
-#define M_SDIV 0x1
+ #define M_MDIV 0xA1
+ #define M_PDIV 0x3
+ #define M_SDIV 0x1
#endif
#define USB_CLOCK 1
#if USB_CLOCK==0
-#define U_M_MDIV 0xA1
-#define U_M_PDIV 0x3
-#define U_M_SDIV 0x1
+ #define U_M_MDIV 0xA1
+ #define U_M_PDIV 0x3
+ #define U_M_SDIV 0x1
#elif USB_CLOCK==1
-#define U_M_MDIV 0x48
-#define U_M_PDIV 0x3
-#define U_M_SDIV 0x2
+ #define U_M_MDIV 0x48
+ #define U_M_PDIV 0x3
+ #define U_M_SDIV 0x2
#endif
-static inline void delay (unsigned long loops)
+static inline void delay(unsigned long loops)
{
- __asm__ volatile ("1:\n"
- "subs %0, %1, #1\n"
- "bne 1b":"=r" (loops):"0" (loops));
+ __asm__ volatile("1:\n"
+ "subs %0, %1, #1\n" "bne 1b":"=r" (loops):"0"(loops));
}
/*
* Miscellaneous platform dependent initialisations
*/
-int board_init (void)
+int board_init(void)
{
- struct s3c24x0_clock_power * const clk_power =
- s3c24x0_get_base_clock_power();
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_clock_power *const clk_power =
+ s3c24x0_get_base_clock_power();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* to reduce PLL lock time, adjust the LOCKTIME register */
- clk_power->LOCKTIME = 0xFFFFFF;
+ writel(0xFFFFFF, &clk_power->locktime);
/* configure MPLL */
- clk_power->MPLLCON = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
+ writel((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV, &clk_power->mpllcon);
/* some delay between MPLL and UPLL */
- delay (4000);
+ delay(4000);
/* configure UPLL */
- clk_power->UPLLCON = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);
+ writel((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV,
+ &clk_power->upllcon);
/* some delay between MPLL and UPLL */
- delay (8000);
+ delay(8000);
/* set up the I/O ports */
- gpio->GPACON = 0x007FFFFF;
- gpio->GPBCON = 0x00044555;
- gpio->GPBUP = 0x000007FF;
- gpio->GPCCON = 0xAAAAAAAA;
- gpio->GPCUP = 0x0000FFFF;
- gpio->GPDCON = 0xAAAAAAAA;
- gpio->GPDUP = 0x0000FFFF;
- gpio->GPECON = 0xAAAAAAAA;
- gpio->GPEUP = 0x0000FFFF;
- gpio->GPFCON = 0x000055AA;
- gpio->GPFUP = 0x000000FF;
- gpio->GPGCON = 0xFF95FFBA;
- gpio->GPGUP = 0x0000FFFF;
- gpio->GPHCON = 0x002AFAAA;
- gpio->GPHUP = 0x000007FF;
+ writel(0x007FFFFF, &gpio->gpacon);
+ writel(0x00044555, &gpio->gpbcon);
+ writel(0x000007FF, &gpio->gpbup);
+ writel(0xAAAAAAAA, &gpio->gpccon);
+ writel(0x0000FFFF, &gpio->gpcup);
+ writel(0xAAAAAAAA, &gpio->gpdcon);
+ writel(0x0000FFFF, &gpio->gpdup);
+ writel(0xAAAAAAAA, &gpio->gpecon);
+ writel(0x0000FFFF, &gpio->gpeup);
+ writel(0x000055AA, &gpio->gpfcon);
+ writel(0x000000FF, &gpio->gpfup);
+ writel(0xFF95FFBA, &gpio->gpgcon);
+ writel(0x0000FFFF, &gpio->gpgup);
+ writel(0x002AFAAA, &gpio->gphcon);
+ writel(0x000007FF, &gpio->gphup);
/* arch number of SMDK2410-Board */
gd->bd->bi_arch_number = MACH_TYPE_SMDK2410;
@@ -116,7 +117,7 @@ int board_init (void)
return 0;
}
-int dram_init (void)
+int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
@@ -125,7 +126,7 @@ int dram_init (void)
}
#ifdef CONFIG_CMD_NET
-int board_eth_init(bd_t *bis)
+int board_eth_init(bd_t * bis)
{
int rc = 0;
#ifdef CONFIG_CS8900
diff --git a/board/sbc2410x/sbc2410x.c b/board/sbc2410x/sbc2410x.c
index 3a93677..23bb386 100644
--- a/board/sbc2410x/sbc2410x.c
+++ b/board/sbc2410x/sbc2410x.c
@@ -31,6 +31,7 @@
#include <common.h>
#include <netdev.h>
#include <asm/arch/s3c24x0_cpu.h>
+#include <asm/io.h>
#if defined(CONFIG_CMD_NAND)
#include <linux/mtd/nand.h>
@@ -41,79 +42,78 @@ DECLARE_GLOBAL_DATA_PTR;
#define FCLK_SPEED 1
#if FCLK_SPEED==0 /* Fout = 203MHz, Fin = 12MHz for Audio */
-#define M_MDIV 0xC3
-#define M_PDIV 0x4
-#define M_SDIV 0x1
+ #define M_MDIV 0xC3
+ #define M_PDIV 0x4
+ #define M_SDIV 0x1
#elif FCLK_SPEED==1 /* Fout = 202.8MHz */
-#define M_MDIV 0x5c
-#define M_PDIV 0x4
-#define M_SDIV 0x0
+ #define M_MDIV 0x5c
+ #define M_PDIV 0x4
+ #define M_SDIV 0x0
#endif
#define USB_CLOCK 1
#if USB_CLOCK==0
-#define U_M_MDIV 0xA1
-#define U_M_PDIV 0x3
-#define U_M_SDIV 0x1
+ #define U_M_MDIV 0xA1
+ #define U_M_PDIV 0x3
+ #define U_M_SDIV 0x1
#elif USB_CLOCK==1
-#define U_M_MDIV 0x48
-#define U_M_PDIV 0x3
-#define U_M_SDIV 0x2
+ #define U_M_MDIV 0x48
+ #define U_M_PDIV 0x3
+ #define U_M_SDIV 0x2
#endif
-static inline void delay (unsigned long loops)
+static inline void delay(unsigned long loops)
{
- __asm__ volatile ("1:\n"
- "subs %0, %1, #1\n"
- "bne 1b":"=r" (loops):"0" (loops));
+ __asm__ volatile("1:\n"
+ "subs %0, %1, #1\n" "bne 1b":"=r" (loops):"0"(loops));
}
/*
* Miscellaneous platform dependent initialisations
*/
-int board_init (void)
+int board_init(void)
{
- struct s3c24x0_clock_power * const clk_power =
- s3c24x0_get_base_clock_power();
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_clock_power *const clk_power =
+ s3c24x0_get_base_clock_power();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* to reduce PLL lock time, adjust the LOCKTIME register */
- clk_power->LOCKTIME = 0xFFFFFF;
+ writel(0xFFFFFF, &clk_power->locktime);
/* configure MPLL */
- clk_power->MPLLCON = ((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV);
+ writel((M_MDIV << 12) + (M_PDIV << 4) + M_SDIV, &clk_power->mpllcon);
/* some delay between MPLL and UPLL */
- delay (4000);
+ delay(4000);
/* configure UPLL */
- clk_power->UPLLCON = ((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV);
+ writel((U_M_MDIV << 12) + (U_M_PDIV << 4) + U_M_SDIV, &clk_power->upllcon);
/* some delay between MPLL and UPLL */
- delay (8000);
+ delay(8000);
/* set up the I/O ports */
- gpio->GPACON = 0x007FFFFF;
- gpio->GPBCON = 0x00044556;
- gpio->GPBUP = 0x000007FF;
- gpio->GPCCON = 0xAAAAAAAA;
- gpio->GPCUP = 0x0000FFFF;
- gpio->GPDCON = 0xAAAAAAAA;
- gpio->GPDUP = 0x0000FFFF;
- gpio->GPECON = 0xAAAAAAAA;
- gpio->GPEUP = 0x0000FFFF;
- gpio->GPFCON = 0x000055AA;
- gpio->GPFUP = 0x000000FF;
- gpio->GPGCON = 0xFF95FF3A;
- gpio->GPGUP = 0x0000FFFF;
- gpio->GPHCON = 0x0016FAAA;
- gpio->GPHUP = 0x000007FF;
-
- gpio->EXTINT0=0x22222222;
- gpio->EXTINT1=0x22222222;
- gpio->EXTINT2=0x22222222;
+ writel(0x007FFFFF, &gpio->gpacon);
+ writel(0x00044556, &gpio->gpbcon);
+ writel(0x000007FF, &gpio->gpbup);
+ writel(0xAAAAAAAA, &gpio->gpccon);
+ writel(0x0000FFFF, &gpio->gpcup);
+ writel(0xAAAAAAAA, &gpio->gpdcon);
+ writel(0x0000FFFF, &gpio->gpdup);
+ writel(0xAAAAAAAA, &gpio->gpecon);
+ writel(0x0000FFFF, &gpio->gpeup);
+ writel(0x000055AA, &gpio->gpfcon);
+ writel(0x000000FF, &gpio->gpfup);
+ writel(0xFF95FF3A, &gpio->gpgcon);
+ writel(0x0000FFFF, &gpio->gpgup);
+ writel(0x0016FAAA, &gpio->gphcon);
+ writel(0x000007FF, &gpio->gphup);
+
+ writel(0x22222222, &gpio->extint0);
+ writel(0x22222222, &gpio->extint1);
+ writel(0x22222222, &gpio->extint2);
/* arch number of SMDK2410-Board */
gd->bd->bi_arch_number = MACH_TYPE_SMDK2410;
@@ -127,7 +127,7 @@ int board_init (void)
return 0;
}
-int dram_init (void)
+int dram_init(void)
{
gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
@@ -138,51 +138,52 @@ int dram_init (void)
#if defined(CONFIG_CMD_NAND)
extern ulong nand_probe(ulong physadr);
-static inline void NF_Reset(void)
+static inline void nf_reset(void)
{
int i;
- NF_SetCE(NFCE_LOW);
- NF_Cmd(0xFF); /* reset command */
- for(i = 0; i < 10; i++); /* tWB = 100ns. */
- NF_WaitRB(); /* wait 200~500us; */
- NF_SetCE(NFCE_HIGH);
+ nf_setce(NFCE_LOW);
+ nf_cmd(0xFF); /* reset command */
+ for (i = 0; i < 10; i++) ; /* tWB = 100ns. */
+ nf_waitrb(); /* wait 200~500us; */
+ nf_setce(NFCE_HIGH);
}
-static inline void NF_Init(void)
+static inline void nf_init(void)
{
#if 1
-#define TACLS 0
-#define TWRPH0 3
-#define TWRPH1 0
+ #define TACLS 0
+ #define TWRPH0 3
+ #define TWRPH1 0
#else
-#define TACLS 0
-#define TWRPH0 4
-#define TWRPH1 2
+ #define TACLS 0
+ #define TWRPH0 4
+ #define TWRPH1 2
#endif
- NF_Conf((1<<15)|(0<<14)|(0<<13)|(1<<12)|(1<<11)|(TACLS<<8)|(TWRPH0<<4)|(TWRPH1<<0));
+ nf_conf((1 << 15) | (0 << 14) | (0 << 13) | (1 << 12) | (1 << 11) |
+ (TACLS << 8) | (TWRPH0 << 4) | (TWRPH1 << 0));
/*nand->NFCONF = (1<<15)|(1<<14)|(1<<13)|(1<<12)|(1<<11)|(TACLS<<8)|(TWRPH0<<4)|(TWRPH1<<0); */
/* 1 1 1 1, 1 xxx, r xxx, r xxx */
/* En 512B 4step ECCR nFCE=H tACLS tWRPH0 tWRPH1 */
- NF_Reset();
+ nf_reset();
}
void nand_init(void)
{
- struct s3c2410_nand * const nand = s3c2410_get_base_nand();
+ struct s3c2410_nand *const nand = s3c2410_get_base_nand();
- NF_Init();
+ nf_init();
#ifdef DEBUG
- printf("NAND flash probing at 0x%.8lX\n", (ulong)nand);
+ printf("NAND flash probing at 0x%.8lX\n", (ulong) nand);
#endif
- printf ("%4lu MB\n", nand_probe((ulong)nand) >> 20);
+ printf("%4lu MB\n", nand_probe((ulong) nand) >> 20);
}
#endif
#ifdef CONFIG_CMD_NET
-int board_eth_init(bd_t *bis)
+int board_eth_init(bd_t * bis)
{
int rc = 0;
#ifdef CONFIG_CS8900
diff --git a/board/trab/cmd_trab.c b/board/trab/cmd_trab.c
index 472d7d8..867b86d 100644
--- a/board/trab/cmd_trab.c
+++ b/board/trab/cmd_trab.c
@@ -26,6 +26,7 @@
#include <common.h>
#include <command.h>
#include <asm/arch/s3c24x0_cpu.h>
+#include <asm/io.h>
#include <rtc.h>
/*
@@ -56,13 +57,13 @@
#define LED_BLINK_FREQ 5
/* delay time between burn in cycles in seconds */
-#ifndef BURN_IN_CYCLE_DELAY /* if not defined in include/configs/trab.h */
+#ifndef BURN_IN_CYCLE_DELAY /* if not defined in include/configs/trab.h */
#define BURN_IN_CYCLE_DELAY 5
#endif
/* physical SRAM parameters */
-#define SRAM_ADDR 0x02000000 /* GCS1 */
-#define SRAM_SIZE 0x40000 /* 256 kByte */
+#define SRAM_ADDR 0x02000000 /* GCS1 */
+#define SRAM_SIZE 0x40000 /* 256 kByte */
/* CPLD-Register for controlling TRAB hardware functions */
#define CPLD_BUTTONS ((volatile unsigned long *)0x04020000)
@@ -101,45 +102,44 @@
/* misc */
/* externals */
-extern int memory_post_tests (unsigned long start, unsigned long size);
-extern int i2c_write (uchar, uint, int , uchar* , int);
-extern int i2c_read (uchar, uint, int , uchar* , int);
-extern void tsc2000_reg_init (void);
-extern s32 tsc2000_contact_temp (void);
+extern int memory_post_tests(unsigned long start, unsigned long size);
+extern int i2c_write(uchar, uint, int, uchar *, int);
+extern int i2c_read(uchar, uint, int, uchar *, int);
+extern void tsc2000_reg_init(void);
+extern s32 tsc2000_contact_temp(void);
extern void tsc2000_spi_init(void);
/* function declarations */
-int do_dip (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-int do_vcc5v (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-int do_contact_temp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-int do_burn_in_status (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-int i2c_write_multiple (uchar chip, uint addr, int alen,
- uchar *buffer, int len);
-int i2c_read_multiple (uchar chip, uint addr, int alen,
- uchar *buffer, int len);
-int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+int do_dip(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
+int do_vcc5v(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
+int do_burn_in(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
+int do_contact_temp(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
+int do_burn_in_status(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
+int i2c_write_multiple(uchar chip, uint addr, int alen,
+ uchar * buffer, int len);
+int i2c_read_multiple(uchar chip, uint addr, int alen, uchar * buffer, int len);
+int do_temp_log(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
/* helper functions */
-static void adc_init (void);
-static int adc_read (unsigned int channel);
-static int read_dip (void);
-static int read_vcc5v (void);
-static int test_dip (void);
-static int test_vcc5v (void);
-static int test_rotary_switch (void);
-static int test_sram (void);
-static int test_eeprom (void);
-static int test_contact_temp (void);
-static void led_set (unsigned int);
-static void led_blink (void);
-static void led_init (void);
-static void sdelay (unsigned long seconds); /* delay in seconds */
-static int dummy (void);
+static void adc_init(void);
+static int adc_read(unsigned int channel);
+static int read_dip(void);
+static int read_vcc5v(void);
+static int test_dip(void);
+static int test_vcc5v(void);
+static int test_rotary_switch(void);
+static int test_sram(void);
+static int test_eeprom(void);
+static int test_contact_temp(void);
+static void led_set(unsigned int);
+static void led_blink(void);
+static void led_init(void);
+static void sdelay(unsigned long seconds); /* delay in seconds */
+static int dummy(void);
static int read_max_cycles(void);
-static void test_function_table_init (void);
-static void global_vars_init (void);
-static int global_vars_write_to_eeprom (void);
+static void test_function_table_init(void);
+static void global_vars_init(void);
+static int global_vars_write_to_eeprom(void);
/* globals */
u16 max_cycles;
@@ -152,7 +152,7 @@ u16 act_cycle;
typedef struct test_function_s {
char *name;
- int (*pf)(void);
+ int (*pf) (void);
} test_function_t;
/* max number of Burn In Functions */
@@ -161,8 +161,7 @@ typedef struct test_function_s {
/* table with burn in functions */
test_function_t test_function[BIF_MAX];
-
-int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_burn_in(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
int i;
int cycle_status;
@@ -172,25 +171,25 @@ int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
- led_init ();
- global_vars_init ();
- test_function_table_init ();
- tsc2000_spi_init ();
+ led_init();
+ global_vars_init();
+ test_function_table_init();
+ tsc2000_spi_init();
- if (global_vars_write_to_eeprom () != 0) {
- printf ("%s: error writing global_vars to eeprom\n",
- __FUNCTION__);
+ if (global_vars_write_to_eeprom() != 0) {
+ printf("%s: error writing global_vars to eeprom\n",
+ __FUNCTION__);
return (1);
}
- if (read_max_cycles () != 0) {
- printf ("%s: error reading max_cycles from eeprom\n",
- __FUNCTION__);
+ if (read_max_cycles() != 0) {
+ printf("%s: error reading max_cycles from eeprom\n",
+ __FUNCTION__);
return (1);
}
if (max_cycles == 0) {
- printf ("%s: error, burn in max_cycles = 0\n", __FUNCTION__);
+ printf("%s: error, burn in max_cycles = 0\n", __FUNCTION__);
return (1);
}
@@ -203,13 +202,13 @@ int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* avoid timestamp overflow problem after about 68 minutes of
* udelay() time.
*/
- reset_timer_masked ();
+ reset_timer_masked();
for (i = 0; i < BIF_MAX; i++) {
/* call test function */
- if ((*test_function[i].pf)() != 0) {
- printf ("error in %s test\n",
- test_function[i].name);
+ if ((*test_function[i].pf) () != 0) {
+ printf("error in %s test\n",
+ test_function[i].name);
/* is it the first error? */
if (status == 0) {
@@ -217,11 +216,11 @@ int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
first_error_cycle = act_cycle;
/* do not use error_num 0 */
- first_error_num = i+1;
- strncpy (first_error_name,
- test_function[i].name,
- sizeof (first_error_name));
- led_set (0);
+ first_error_num = i + 1;
+ strncpy(first_error_name,
+ test_function[i].name,
+ sizeof(first_error_name));
+ led_set(0);
}
cycle_status = 1;
}
@@ -232,41 +231,38 @@ int do_burn_in (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* set status LED if no error is occoured since yet */
if (status == 0)
- led_set (1);
+ led_set(1);
- printf ("%s: cycle %d finished\n", __FUNCTION__, act_cycle);
+ printf("%s: cycle %d finished\n", __FUNCTION__, act_cycle);
/* pause between cycles */
- sdelay (BURN_IN_CYCLE_DELAY);
+ sdelay(BURN_IN_CYCLE_DELAY);
}
- if (global_vars_write_to_eeprom () != 0) {
- led_set (0);
- printf ("%s: error writing global_vars to eeprom\n",
- __FUNCTION__);
+ if (global_vars_write_to_eeprom() != 0) {
+ led_set(0);
+ printf("%s: error writing global_vars to eeprom\n",
+ __FUNCTION__);
status = 1;
}
if (status == 0) {
- led_blink (); /* endless loop!! */
+ led_blink(); /* endless loop!! */
return (0);
} else {
- led_set (0);
+ led_set(0);
return (1);
}
}
-U_BOOT_CMD(
- burn_in, 1, 1, do_burn_in,
- "start burn-in test application on TRAB",
- "\n"
- " - start burn-in test application\n"
- " The burn-in test could took a while to finish!\n"
- " The content of the onboard EEPROM is modified!"
-);
-
+U_BOOT_CMD(burn_in, 1, 1, do_burn_in,
+ "start burn-in test application on TRAB",
+ "\n"
+ " - start burn-in test application\n"
+ " The burn-in test could took a while to finish!\n"
+ " The content of the onboard EEPROM is modified!");
-int do_dip (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dip(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
int i, dip;
@@ -275,7 +271,7 @@ int do_dip (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
- if ((dip = read_dip ()) == -1) {
+ if ((dip = read_dip()) == -1) {
return 1;
}
@@ -290,16 +286,13 @@ int do_dip (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
-U_BOOT_CMD(
- dip, 1, 1, do_dip,
- "read dip switch on TRAB",
- "\n"
- " - read state of dip switch (S1) on TRAB board\n"
- " read sequence: 1-2-3-4; ON=1; OFF=0; e.g.: \"0100\""
-);
-
+U_BOOT_CMD(dip, 1, 1, do_dip,
+ "read dip switch on TRAB",
+ "\n"
+ " - read state of dip switch (S1) on TRAB board\n"
+ " read sequence: 1-2-3-4; ON=1; OFF=0; e.g.: \"0100\"");
-int do_vcc5v (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_vcc5v(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
int vcc5v;
@@ -308,26 +301,22 @@ int do_vcc5v (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
- if ((vcc5v = read_vcc5v ()) == -1) {
+ if ((vcc5v = read_vcc5v()) == -1) {
return (1);
}
- printf ("%d", (vcc5v / 1000));
- printf (".%d", (vcc5v % 1000) / 100);
- printf ("%d V\n", (vcc5v % 100) / 10) ;
+ printf("%d", (vcc5v / 1000));
+ printf(".%d", (vcc5v % 1000) / 100);
+ printf("%d V\n", (vcc5v % 100) / 10);
return 0;
}
-U_BOOT_CMD(
- vcc5v, 1, 1, do_vcc5v,
- "read VCC5V on TRAB",
- "\n"
- " - read actual value of voltage VCC5V"
-);
+U_BOOT_CMD(vcc5v, 1, 1, do_vcc5v,
+ "read VCC5V on TRAB",
+ "\n" " - read actual value of voltage VCC5V");
-
-int do_contact_temp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_contact_temp(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
int contact_temp;
@@ -336,75 +325,69 @@ int do_contact_temp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1;
}
- tsc2000_spi_init ();
+ tsc2000_spi_init();
contact_temp = tsc2000_contact_temp();
- printf ("%d degree C * 100\n", contact_temp) ;
+ printf("%d degree C * 100\n", contact_temp);
return 0;
}
-U_BOOT_CMD(
- c_temp, 1, 1, do_contact_temp,
- "read contact temperature on TRAB",
- ""
- " - reads the onboard temperature (=contact temperature)\n"
-);
-
+U_BOOT_CMD(c_temp, 1, 1, do_contact_temp,
+ "read contact temperature on TRAB",
+ "" " - reads the onboard temperature (=contact temperature)\n");
-int do_burn_in_status (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_burn_in_status(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
if (argc > 1) {
cmd_usage(cmdtp);
return 1;
}
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_STATUS, 1,
- (unsigned char*) &status, 1)) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_STATUS, 1,
+ (unsigned char *)&status, 1)) {
return (1);
}
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_PASS_CYCLES, 1,
- (unsigned char*) &pass_cycles, 2)) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_PASS_CYCLES, 1,
+ (unsigned char *)&pass_cycles, 2)) {
return (1);
}
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_CYCLE,
- 1, (unsigned char*) &first_error_cycle, 2)) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_CYCLE,
+ 1, (unsigned char *)&first_error_cycle, 2)) {
return (1);
}
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_NUM,
- 1, (unsigned char*) &first_error_num, 1)) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_NUM,
+ 1, (unsigned char *)&first_error_num, 1)) {
return (1);
}
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_NAME,
- 1, (unsigned char*)first_error_name,
- sizeof (first_error_name))) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_NAME,
+ 1, (unsigned char *)first_error_name,
+ sizeof(first_error_name))) {
return (1);
}
- if (read_max_cycles () != 0) {
+ if (read_max_cycles() != 0) {
return (1);
}
- printf ("max_cycles = %d\n", max_cycles);
- printf ("status = %d\n", status);
- printf ("pass_cycles = %d\n", pass_cycles);
- printf ("first_error_cycle = %d\n", first_error_cycle);
- printf ("first_error_num = %d\n", first_error_num);
- printf ("first_error_name = %.*s\n",(int) sizeof(first_error_name),
- first_error_name);
+ printf("max_cycles = %d\n", max_cycles);
+ printf("status = %d\n", status);
+ printf("pass_cycles = %d\n", pass_cycles);
+ printf("first_error_cycle = %d\n", first_error_cycle);
+ printf("first_error_num = %d\n", first_error_num);
+ printf("first_error_name = %.*s\n", (int)sizeof(first_error_name),
+ first_error_name);
return 0;
}
-U_BOOT_CMD(
- bis, 1, 1, do_burn_in_status,
- "print burn in status on TRAB",
- "\n"
- " - prints the status variables of the last burn in test\n"
- " stored in the onboard EEPROM on TRAB board"
-);
+U_BOOT_CMD(bis, 1, 1, do_burn_in_status,
+ "print burn in status on TRAB",
+ "\n"
+ " - prints the status variables of the last burn in test\n"
+ " stored in the onboard EEPROM on TRAB board");
-static int read_dip (void)
+static int read_dip(void)
{
unsigned int result = 0;
int adc_val;
@@ -423,9 +406,9 @@ static int read_dip (void)
for (i = 7; i > 3; i--) {
- if ((adc_val = adc_read (i)) == -1) {
- printf ("%s: Channel %d could not be read\n",
- __FUNCTION__, i);
+ if ((adc_val = adc_read(i)) == -1) {
+ printf("%s: Channel %d could not be read\n",
+ __FUNCTION__, i);
return (-1);
}
@@ -435,20 +418,19 @@ static int read_dip (void)
* Set trigger at halve that value.
*/
if (adc_val < 368)
- result |= (1 << (i-4));
+ result |= (1 << (i - 4));
}
return (result);
}
-
-static int read_vcc5v (void)
+static int read_vcc5v(void)
{
s32 result;
/* VCC5V is connected to channel 2 */
- if ((result = adc_read (2)) == -1) {
- printf ("%s: VCC5V could not be read\n", __FUNCTION__);
+ if ((result = adc_read(2)) == -1) {
+ printf("%s: VCC5V could not be read\n", __FUNCTION__);
return (-1);
}
/*
@@ -456,50 +438,47 @@ static int read_vcc5v (void)
* floating point support. VCC5V is connected over an resistor divider:
* VCC5V=ADCval*2,5V/1023*(10K+30K)/10K.
*/
- result = result * 10 * 1000 / 1023; /* result in mV */
+ result = result * 10 * 1000 / 1023; /* result in mV */
return (result);
}
-
-static int test_dip (void)
+static int test_dip(void)
{
static int first_run = 1;
static int first_dip;
if (first_run) {
- if ((first_dip = read_dip ()) == -1) {
+ if ((first_dip = read_dip()) == -1) {
return (1);
}
first_run = 0;
- debug ("%s: first_dip=%d\n", __FUNCTION__, first_dip);
+ debug("%s: first_dip=%d\n", __FUNCTION__, first_dip);
}
- if (first_dip != read_dip ()) {
+ if (first_dip != read_dip()) {
return (1);
} else {
return (0);
}
}
-
-static int test_vcc5v (void)
+static int test_vcc5v(void)
{
int vcc5v;
- if ((vcc5v = read_vcc5v ()) == -1) {
+ if ((vcc5v = read_vcc5v()) == -1) {
return (1);
}
if ((vcc5v > VCC5V_MAX) || (vcc5v < VCC5V_MIN)) {
- printf ("%s: vcc5v[V/100]=%d\n", __FUNCTION__, vcc5v);
+ printf("%s: vcc5v[V/100]=%d\n", __FUNCTION__, vcc5v);
return (1);
} else {
return (0);
}
}
-
-static int test_rotary_switch (void)
+static int test_rotary_switch(void)
{
static int first_run = 1;
static int first_rs;
@@ -513,7 +492,7 @@ static int test_rotary_switch (void)
first_rs = ((*CPLD_ROTARY_SWITCH >> 16) & 0x7);
first_run = 0;
- debug ("%s: first_rs=%d\n", __FUNCTION__, first_rs);
+ debug("%s: first_rs=%d\n", __FUNCTION__, first_rs);
}
if (first_rs != ((*CPLD_ROTARY_SWITCH >> 16) & 0x7)) {
@@ -523,63 +502,60 @@ static int test_rotary_switch (void)
}
}
-
-static int test_sram (void)
+static int test_sram(void)
{
- return (memory_post_tests (SRAM_ADDR, SRAM_SIZE));
+ return (memory_post_tests(SRAM_ADDR, SRAM_SIZE));
}
-
-static int test_eeprom (void)
+static int test_eeprom(void)
{
- unsigned char temp[sizeof (EEPROM_TEST_STRING_1)];
+ unsigned char temp[sizeof(EEPROM_TEST_STRING_1)];
int result = 0;
/* write test string 1, read back and verify */
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_TEST, 1,
- (unsigned char*)EEPROM_TEST_STRING_1,
- sizeof (EEPROM_TEST_STRING_1))) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_TEST, 1,
+ (unsigned char *)EEPROM_TEST_STRING_1,
+ sizeof(EEPROM_TEST_STRING_1))) {
return (1);
}
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_TEST, 1,
- temp, sizeof (EEPROM_TEST_STRING_1))) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_TEST, 1,
+ temp, sizeof(EEPROM_TEST_STRING_1))) {
return (1);
}
- if (strcmp ((char *)temp, EEPROM_TEST_STRING_1) != 0) {
+ if (strcmp((char *)temp, EEPROM_TEST_STRING_1) != 0) {
result = 1;
- printf ("%s: error; read_str = \"%s\"\n", __FUNCTION__, temp);
+ printf("%s: error; read_str = \"%s\"\n", __FUNCTION__, temp);
}
/* write test string 2, read back and verify */
if (result == 0) {
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_TEST, 1,
- (unsigned char*)EEPROM_TEST_STRING_2,
- sizeof (EEPROM_TEST_STRING_2))) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_TEST, 1,
+ (unsigned char *)EEPROM_TEST_STRING_2,
+ sizeof(EEPROM_TEST_STRING_2))) {
return (1);
}
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_TEST, 1,
- temp, sizeof (EEPROM_TEST_STRING_2))) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_TEST, 1,
+ temp, sizeof(EEPROM_TEST_STRING_2))) {
return (1);
}
- if (strcmp ((char *)temp, EEPROM_TEST_STRING_2) != 0) {
+ if (strcmp((char *)temp, EEPROM_TEST_STRING_2) != 0) {
result = 1;
- printf ("%s: error; read str = \"%s\"\n",
- __FUNCTION__, temp);
+ printf("%s: error; read str = \"%s\"\n",
+ __FUNCTION__, temp);
}
}
return (result);
}
-
-static int test_contact_temp (void)
+static int test_contact_temp(void)
{
int contact_temp;
- contact_temp = tsc2000_contact_temp ();
+ contact_temp = tsc2000_contact_temp();
if ((contact_temp < MIN_CONTACT_TEMP)
|| (contact_temp > MAX_CONTACT_TEMP))
@@ -588,110 +564,111 @@ static int test_contact_temp (void)
return (0);
}
-
-int i2c_write_multiple (uchar chip, uint addr, int alen,
- uchar *buffer, int len)
+int i2c_write_multiple(uchar chip, uint addr, int alen, uchar * buffer, int len)
{
int i;
if (alen != 1) {
- printf ("%s: addr len other than 1 not supported\n",
- __FUNCTION__);
+ printf("%s: addr len other than 1 not supported\n",
+ __FUNCTION__);
return (1);
}
for (i = 0; i < len; i++) {
- if (i2c_write (chip, addr+i, alen, buffer+i, 1)) {
- printf ("%s: could not write to i2c device %d"
- ", addr %d\n", __FUNCTION__, chip, addr);
+ if (i2c_write(chip, addr + i, alen, buffer + i, 1)) {
+ printf("%s: could not write to i2c device %d"
+ ", addr %d\n", __FUNCTION__, chip, addr);
return (1);
}
#if 0
- printf ("chip=%#x, addr+i=%#x+%d=%p, alen=%d, *buffer+i="
- "%#x+%d=%p=\"%.1s\"\n", chip, addr, i, addr+i,
- alen, buffer, i, buffer+i, buffer+i);
+ printf("chip=%#x, addr+i=%#x+%d=%p, alen=%d, *buffer+i="
+ "%#x+%d=%p=\"%.1s\"\n", chip, addr, i, addr + i,
+ alen, buffer, i, buffer + i, buffer + i);
#endif
- udelay (30000);
+ udelay(30000);
}
return (0);
}
-
-int i2c_read_multiple ( uchar chip, uint addr, int alen,
- uchar *buffer, int len)
+int i2c_read_multiple(uchar chip, uint addr, int alen, uchar * buffer, int len)
{
int i;
if (alen != 1) {
- printf ("%s: addr len other than 1 not supported\n",
- __FUNCTION__);
+ printf("%s: addr len other than 1 not supported\n",
+ __FUNCTION__);
return (1);
}
for (i = 0; i < len; i++) {
- if (i2c_read (chip, addr+i, alen, buffer+i, 1)) {
- printf ("%s: could not read from i2c device %#x"
- ", addr %d\n", __FUNCTION__, chip, addr);
+ if (i2c_read(chip, addr + i, alen, buffer + i, 1)) {
+ printf("%s: could not read from i2c device %#x"
+ ", addr %d\n", __FUNCTION__, chip, addr);
return (1);
}
}
return (0);
}
-
-static int adc_read (unsigned int channel)
+static int adc_read(unsigned int channel)
{
- int j = 1000; /* timeout value for wait loop in us */
+ int j = 1000; /* timeout value for wait loop in us */
int result;
struct s3c2400_adc *padc;
padc = s3c2400_get_base_adc();
channel &= 0x7;
- adc_init ();
+ adc_init();
- padc->ADCCON &= ~ADC_STDBM; /* select normal mode */
- padc->ADCCON &= ~(0x7 << 3); /* clear the channel bits */
- padc->ADCCON |= ((channel << 3) | ADC_ENABLE_START);
+ /* select normal mode */
+ writel(readl(&padc->adccon) & ~ADC_STDBM, &padc->adccon);
+ /* clear the channel bits */
+ writel(readl(&padc->adccon) & ~(0x7 << 3), &padc->adccon);
+ writel(readl(&padc->adccon) | ((channel << 3) | ADC_ENABLE_START),
+ &padc->adccon);
while (j--) {
- if ((padc->ADCCON & ADC_ENABLE_START) == 0)
+ if ((readl(&padc->adccon) & ADC_ENABLE_START) == 0)
break;
- udelay (1);
+ udelay(1);
}
if (j == 0) {
printf("%s: ADC timeout\n", __FUNCTION__);
- padc->ADCCON |= ADC_STDBM; /* select standby mode */
+ /* select standby mode */
+ writel(readl(&padc->adccon) | ADC_STDBM, &padc->adccon);
return -1;
}
- result = padc->ADCDAT & 0x3FF;
+ result = readl(&padc->adcdat) & 0x3FF;
- padc->ADCCON |= ADC_STDBM; /* select standby mode */
+ /* select standby mode */
+ writel(readl(&padc->adccon) | ADC_STDBM, &padc->adccon);
- debug ("%s: channel %d, result[DIGIT]=%d\n", __FUNCTION__,
- (padc->ADCCON >> 3) & 0x7, result);
+ debug("%s: channel %d, result[DIGIT]=%d\n", __FUNCTION__,
+ (readl(&padc->adccon) >> 3) & 0x7, result);
/*
* Wait for ADC to be ready for next conversion. This delay value was
* estimated, because the datasheet does not specify a value.
*/
- udelay (1000);
+ udelay(1000);
return (result);
}
-
-static void adc_init (void)
+static void adc_init(void)
{
struct s3c2400_adc *padc;
padc = s3c2400_get_base_adc();
- padc->ADCCON &= ~(0xff << 6); /* clear prescaler bits */
- padc->ADCCON |= ((65 << 6) | ADC_PRSCEN); /* set prescaler */
+ /* clear prescaler bits */
+ writel(readl(&padc->adccon) &= ~(0xff << 6), &padc->adccon);
+ /* set prescaler */
+ writel(readl(&padc->adccon) | ((65 << 6) | ADC_PRSCEN), &padc->adccon);
/*
* Wait some time to avoid problem with very first call of
@@ -699,104 +676,99 @@ static void adc_init (void)
* adc value is 0. Perhaps because the adjustment of prescaler
* takes some clock cycles?
*/
- udelay (1000);
+ udelay(1000);
return;
}
-
-static void led_set (unsigned int state)
+static void led_set(unsigned int state)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
- led_init ();
+ led_init();
switch (state) {
- case 0: /* turn LED off */
- gpio->PADAT |= (1 << 12);
+ case 0: /* turn LED off */
+ writel(readl(&gpio->padat) | (1 << 12), &gpio->padat);
break;
- case 1: /* turn LED on */
- gpio->PADAT &= ~(1 << 12);
+ case 1: /* turn LED on */
+ writel(readl(&gpio->padat) & ~(1 << 12), &gpio->padat);
break;
default:
break;
}
}
-static void led_blink (void)
+static void led_blink(void)
{
- led_init ();
+ led_init();
/* blink LED. This function does not return! */
while (1) {
- reset_timer_masked ();
- led_set (1);
- udelay (1000000 / LED_BLINK_FREQ / 2);
- led_set (0);
- udelay (1000000 / LED_BLINK_FREQ / 2);
+ reset_timer_masked();
+ led_set(1);
+ udelay(1000000 / LED_BLINK_FREQ / 2);
+ led_set(0);
+ udelay(1000000 / LED_BLINK_FREQ / 2);
}
}
-
-static void led_init (void)
+static void led_init(void)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* configure GPA12 as output and set to High -> LED off */
- gpio->PACON &= ~(1 << 12);
- gpio->PADAT |= (1 << 12);
+ writel(readl(&gpio->pacon) & ~(1 << 12), &gpio->pacon);
+ writel(readl(&gpio->pacon) | (1 << 12), &gpio->padat);
}
-
-static void sdelay (unsigned long seconds)
+static void sdelay(unsigned long seconds)
{
unsigned long i;
for (i = 0; i < seconds; i++) {
- udelay (1000000);
+ udelay(1000000);
}
}
-
-static int global_vars_write_to_eeprom (void)
+static int global_vars_write_to_eeprom(void)
{
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_STATUS, 1,
- (unsigned char*) &status, 1)) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_STATUS, 1,
+ (unsigned char *)&status, 1)) {
return (1);
}
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_PASS_CYCLES, 1,
- (unsigned char*) &pass_cycles, 2)) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_PASS_CYCLES, 1,
+ (unsigned char *)&pass_cycles, 2)) {
return (1);
}
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_CYCLE,
- 1, (unsigned char*) &first_error_cycle, 2)) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_CYCLE,
+ 1, (unsigned char *)&first_error_cycle, 2)) {
return (1);
}
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_NUM,
- 1, (unsigned char*) &first_error_num, 1)) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_NUM,
+ 1, (unsigned char *)&first_error_num, 1)) {
return (1);
}
- if (i2c_write_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_NAME,
- 1, (unsigned char*) first_error_name,
- sizeof(first_error_name))) {
+ if (i2c_write_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_FIRST_ERROR_NAME,
+ 1, (unsigned char *)first_error_name,
+ sizeof(first_error_name))) {
return (1);
}
return (0);
}
-static void global_vars_init (void)
+static void global_vars_init(void)
{
- status = 1; /* error */
- pass_cycles = 0;
- first_error_cycle = 0;
- first_error_num = 0;
- first_error_name[0] = '\0';
- act_cycle = 0;
- max_cycles = 0;
+ status = 1; /* error */
+ pass_cycles = 0;
+ first_error_cycle = 0;
+ first_error_num = 0;
+ first_error_name[0] = '\0';
+ act_cycle = 0;
+ max_cycles = 0;
}
-
-static void test_function_table_init (void)
+static void test_function_table_init(void)
{
int i;
@@ -826,11 +798,10 @@ static void test_function_table_init (void)
test_function[5].name = "contact_temp";
}
-
-static int read_max_cycles (void)
+static int read_max_cycles(void)
{
- if (i2c_read_multiple (I2C_EEPROM_DEV_ADDR, EE_ADDR_MAX_CYCLES, 1,
- (unsigned char *) &max_cycles, 2) != 0) {
+ if (i2c_read_multiple(I2C_EEPROM_DEV_ADDR, EE_ADDR_MAX_CYCLES, 1,
+ (unsigned char *)&max_cycles, 2) != 0) {
return (1);
}
@@ -842,7 +813,7 @@ static int dummy(void)
return (0);
}
-int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_temp_log(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
int contact_temp;
int delay = 0;
@@ -859,38 +830,36 @@ int do_temp_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
delay = simple_strtoul(argv[1], NULL, 10);
}
- tsc2000_spi_init ();
+ tsc2000_spi_init();
while (1) {
#if defined(CONFIG_CMD_DATE)
- rtc_get (&tm);
- printf ("%4d-%02d-%02d %2d:%02d:%02d - ",
- tm.tm_year, tm.tm_mon, tm.tm_mday,
- tm.tm_hour, tm.tm_min, tm.tm_sec);
+ rtc_get(&tm);
+ printf("%4d-%02d-%02d %2d:%02d:%02d - ",
+ tm.tm_year, tm.tm_mon, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec);
#endif
contact_temp = tsc2000_contact_temp();
- printf ("%d\n", contact_temp) ;
+ printf("%d\n", contact_temp);
if (delay != 0)
/*
* reset timer to avoid timestamp overflow problem
* after about 68 minutes of udelay() time.
*/
- reset_timer_masked ();
- sdelay (delay);
+ reset_timer_masked();
+ sdelay(delay);
}
return 0;
}
-U_BOOT_CMD(
- tlog, 2, 1, do_temp_log,
- "log contact temperature [1/100 C] to console (endlessly)",
- "delay\n"
- " - contact temperature [1/100 C] is printed endlessly to console\n"
- " <delay> specifies the seconds to wait between two measurements\n"
- " For each measurment a timestamp is printeted"
-);
+U_BOOT_CMD(tlog, 2, 1, do_temp_log,
+ "log contact temperature [1/100 C] to console (endlessly)",
+ "delay\n"
+ " - contact temperature [1/100 C] is printed endlessly to console\n"
+ " <delay> specifies the seconds to wait between two measurements\n"
+ " For each measurment a timestamp is printeted");
#endif
diff --git a/board/trab/rs485.c b/board/trab/rs485.c
index ad0c136..80fbf26 100644
--- a/board/trab/rs485.c
+++ b/board/trab/rs485.c
@@ -23,13 +23,14 @@
#include <common.h>
#include <asm/arch/s3c24x0_cpu.h>
+#include <asm/io.h>
#include "rs485.h"
-static void rs485_setbrg (void);
-static void rs485_cfgio (void);
+static void rs485_setbrg(void);
+static void rs485_cfgio(void);
static void set_rs485re(unsigned char rs485re_state);
static void set_rs485de(unsigned char rs485de_state);
-static void rs485_setbrg (void);
+static void rs485_setbrg(void);
#ifdef NOT_USED
static void trab_rs485_disable_tx(void);
static void trab_rs485_disable_rx(void);
@@ -40,9 +41,9 @@ static void trab_rs485_disable_rx(void);
/* CPLD-Register for controlling TRAB hardware functions */
#define CPLD_RS485_RE ((volatile unsigned long *)0x04028000)
-static void rs485_setbrg (void)
+static void rs485_setbrg(void)
{
- struct s3c24x0_uart * const uart = s3c24x0_get_base_uart(UART_NR);
+ struct s3c24x0_uart *const uart = s3c24x0_get_base_uart(UART_NR);
int i;
unsigned int reg = 0;
@@ -51,34 +52,39 @@ static void rs485_setbrg (void)
reg = (33000000 / (16 * 38400)) - 1;
/* FIFO enable, Tx/Rx FIFO clear */
- uart->UFCON = 0x07;
- uart->UMCON = 0x0;
+ writel(0x07, &uart->ufcon);
+ writel(0x0, &uart->umcon);
/* Normal,No parity,1 stop,8 bit */
- uart->ULCON = 0x3;
+ writel(0x3, &uart->ulcon);
/*
* tx=level,rx=edge,disable timeout int.,enable rx error int.,
* normal,interrupt or polling
*/
- uart->UCON = 0x245;
- uart->UBRDIV = reg;
+ writel(0x245, &uart->ucon);
+ writel(reg, &uart->ubrdiv);
- for (i = 0; i < 100; i++);
+ for (i = 0; i < 100; i++) ;
}
-static void rs485_cfgio (void)
+static void rs485_cfgio(void)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
- gpio->PFCON &= ~(0x3 << 2);
- gpio->PFCON |= (0x2 << 2); /* configure GPF1 as RXD1 */
+ writel(readl(&gpio->pfcon) & ~(0x3 << 2), &gpio->pfcon);
+ /* configure GPF1 as RXD1 */
+ writel(readl(&gpio->pfcon) | (0x2 << 2), &gpio->pfcon);
- gpio->PFCON &= ~(0x3 << 6);
- gpio->PFCON |= (0x2 << 6); /* configure GPF3 as TXD1 */
+ writel(readl(&gpio->pfcon) & ~(0x3 << 6), &gpio->pfcon);
+ /* configure GPF3 as TXD1 */
+ writel(readl(&gpio->pfcon) | (0x2 << 6), &gpio->pfcon);
- gpio->PFUP |= (1 << 1); /* disable pullup on GPF1 */
- gpio->PFUP |= (1 << 3); /* disable pullup on GPF3 */
+ /* disable pullup on GPF1 */
+ writel(readl(&gpio->pfup) | (1 << 1), &gpio->pfup);
+ /* disable pullup on GPF3 */
+ writel(readl(&gpio->pfup) | (1 << 3), &gpio->pfup);
- gpio->PACON &= ~(1 << 11); /* set GPA11 (RS485_DE) to output */
+ /* set GPA11 (RS485_DE) to output */
+ writel(readl(&gpio->pacon) & ~(1 << 11), &gpio->pacon);
}
/*
@@ -86,10 +92,10 @@ static void rs485_cfgio (void)
* are always 8 data bits, no parity, 1 stop bit, no start bits.
*
*/
-int rs485_init (void)
+int rs485_init(void)
{
- rs485_cfgio ();
- rs485_setbrg ();
+ rs485_cfgio();
+ rs485_setbrg();
return (0);
}
@@ -99,51 +105,50 @@ int rs485_init (void)
* otherwise. When the function is succesfull, the character read is
* written into its argument c.
*/
-int rs485_getc (void)
+int rs485_getc(void)
{
- struct s3c24x0_uart * const uart = s3c24x0_get_base_uart(UART_NR);
+ struct s3c24x0_uart *const uart = s3c24x0_get_base_uart(UART_NR);
/* wait for character to arrive */
- while (!(uart->UTRSTAT & 0x1));
+ while (!(readl(&uart->utrstat) & 0x1)) ;
- return uart->URXH & 0xff;
+ return readl(&uart->urxh) & 0xff;
}
/*
* Output a single byte to the rs485 port.
*/
-void rs485_putc (const char c)
+void rs485_putc(const char c)
{
- struct s3c24x0_uart * const uart = s3c24x0_get_base_uart(UART_NR);
+ struct s3c24x0_uart *const uart = s3c24x0_get_base_uart(UART_NR);
/* wait for room in the tx FIFO */
- while (!(uart->UTRSTAT & 0x2));
+ while (!(readl(&uart->utrstat) & 0x2)) ;
- uart->UTXH = c;
+ writel(c, &uart->utxh);
/* If \n, also do \r */
if (c == '\n')
- rs485_putc ('\r');
+ rs485_putc('\r');
}
/*
* Test whether a character is in the RX buffer
*/
-int rs485_tstc (void)
+int rs485_tstc(void)
{
- struct s3c24x0_uart * const uart = s3c24x0_get_base_uart(UART_NR);
+ struct s3c24x0_uart *const uart = s3c24x0_get_base_uart(UART_NR);
- return uart->UTRSTAT & 0x1;
+ return readl(&uart->utrstat) & 0x1;
}
-void rs485_puts (const char *s)
+void rs485_puts(const char *s)
{
while (*s) {
- rs485_putc (*s++);
+ rs485_putc(*s++);
}
}
-
/*
* State table:
* RE DE Result
@@ -157,7 +162,7 @@ void rs485_puts (const char *s)
static void set_rs485re(unsigned char rs485re_state)
{
- if(rs485re_state)
+ if (rs485re_state)
*CPLD_RS485_RE = 0x010000;
else
*CPLD_RS485_RE = 0x0;
@@ -168,16 +173,15 @@ static void set_rs485re(unsigned char rs485re_state)
static void set_rs485de(unsigned char rs485de_state)
{
- struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
+ struct s3c24x0_gpio *const gpio = s3c24x0_get_base_gpio();
/* This is on PORT A bit 11 */
- if(rs485de_state)
- gpio->PADAT |= (1 << 11);
+ if (rs485de_state)
+ gpio->padat |= (1 << 11);
else
- gpio->PADAT &= ~(1 << 11);
+ gpio->padat &= ~(1 << 11);
}
-
void trab_rs485_enable_tx(void)
{
set_rs485de(1);
--
1.6.1.2
3
2
This series adds link_off(), a function to calculate
the difference between load address and link address.
Using this function it is possible to make u-boot 100%
PIC by wrapping global data accesses LINK_OFF() calls.
Plenty of examples in the code to show how to use it.
All start.S needs to be updated too and I have done
so with mpc83xx.
-DCONFIG_LINK_OFF in your platform config.mk to
make use of this function.
Needs the -ffixed-r14 patches I just sent or
you can fix the conflicts manually.
Would really appreciate some testing by 83xx owners.
Scott?
Jocke
Joakim Tjernlund (4):
ppc: Add const void *link_off(const void *addr)
Use LINK_OFF to access global data
Use LINK_OFF in enviroment too
ppc: Make mpc83xx start.S relative.
common/cmd_nvedit.c | 2 +
common/console.c | 12 ++++++--
common/env_common.c | 2 +-
common/env_flash.c | 65 ++++++++++++++++++++++++----------------
cpu/mpc83xx/cpu.c | 10 +++---
cpu/mpc83xx/cpu_init.c | 38 ++++++++++++-----------
cpu/mpc83xx/speed.c | 28 +++++++-----------
cpu/mpc83xx/start.S | 35 +++++++++++++++++----
drivers/serial/serial.c | 21 +++++++------
include/common.h | 7 ++++
include/linux/ctype.h | 6 ++--
lib_generic/crc32.c | 7 ++++-
lib_generic/ctype.c | 2 +-
lib_generic/display_options.c | 5 ++-
lib_generic/vsprintf.c | 9 ++++--
lib_ppc/board.c | 5 ++-
lib_ppc/reloc.S | 21 +++++++++++++
tools/updater/ctype.c | 2 +-
18 files changed, 177 insertions(+), 100 deletions(-)
3
7
Attn:Beneficiary.
It is a profound gratitude communicating with you through this medium.
We Acculotto Promotions wish to inform you that your email address with
Ticket Nr.: C:38 R:9,Reference Nr.: 5687SPL876 won prize fund of 1,200,000.00 Euros
categorically in our lottery program.
Please contact our FOREIGN TRANSFER MANAGER, with the below information.
Your Names ............
Your Address ................
Your Country ................
Your Phone No ..............
Your Occupation :..............
Your Age ....................
Sex .................
Accu-Online Claims Office
Contact:Dr.Mario Bruno
Tel: +34-685-279-789
E-Mail:accuconsults@aim.com
Yours Sincerely,
Ruben Clark
Public Relation Officer.
1
0
A previous Commit converted the LAN91C96 Ethernet driver to using the
CONFIG_NET_MULTI API, but did not include full board support. This patch
finishes the job.
Signed-off-by: Ben Warren <biggerbadderben(a)gmail.com>
---
This patch applies to the net/next tree and is necessary to complete previously-
submitted code in that tree
board/apollon/apollon.c | 1 -
board/assabet/assabet.c | 12 ++++++++++++
board/dave/B2/B2.c | 12 ++++++++++++
board/gcplus/gcplus.c | 12 ++++++++++++
board/logicpd/zoom1/zoom1.c | 12 ++++++++++++
board/logicpd/zoom2/zoom2.c | 12 ++++++++++++
board/lubbock/lubbock.c | 12 ++++++++++++
board/ti/omap1510inn/omap1510innovator.c | 12 ++++++++++++
board/ti/omap1610inn/omap1610innovator.c | 12 ++++++++++++
board/ti/omap2420h4/omap2420h4.c | 12 ++++++++++++
board/ti/omap5912osk/omap5912osk.c | 12 ++++++++++++
board/ti/omap730p2/omap730p2.c | 12 ++++++++++++
board/ti/sdp3430/sdp.c | 1 +
include/configs/B2.h | 2 +-
14 files changed, 134 insertions(+), 2 deletions(-)
diff --git a/board/apollon/apollon.c b/board/apollon/apollon.c
index b93e880..4768f58 100644
--- a/board/apollon/apollon.c
+++ b/board/apollon/apollon.c
@@ -95,7 +95,6 @@ void s_init(void)
********************************************************/
int misc_init_r(void)
{
- ether_init(); /* better done here so timers are init'ed */
return (0);
}
diff --git a/board/assabet/assabet.c b/board/assabet/assabet.c
index 6f02db2..753c8d2 100644
--- a/board/assabet/assabet.c
+++ b/board/assabet/assabet.c
@@ -25,6 +25,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <SA-1100.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -117,3 +118,14 @@ dram_init(void)
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/dave/B2/B2.c b/board/dave/B2/B2.c
index ec742ad..096ebbd 100644
--- a/board/dave/B2/B2.c
+++ b/board/dave/B2/B2.c
@@ -25,6 +25,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <asm/hardware.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -125,3 +126,14 @@ int dram_init (void)
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/gcplus/gcplus.c b/board/gcplus/gcplus.c
index 829b597..71607f2 100644
--- a/board/gcplus/gcplus.c
+++ b/board/gcplus/gcplus.c
@@ -25,6 +25,7 @@
*/
#include <common.h>
+#include <netdev.h>
#include <SA-1100.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -68,3 +69,14 @@ dram_init(void)
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c
index f4d3754..a144f52 100644
--- a/board/logicpd/zoom1/zoom1.c
+++ b/board/logicpd/zoom1/zoom1.c
@@ -31,6 +31,7 @@
* MA 02111-1307 USA
*/
#include <common.h>
+#include <netdev.h>
#include <twl4030.h>
#include <asm/io.h>
#include <asm/arch/mux.h>
@@ -86,3 +87,14 @@ void set_muxconf_regs(void)
/* platform specific muxes */
MUX_ZOOM1_MDK();
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/logicpd/zoom2/zoom2.c b/board/logicpd/zoom2/zoom2.c
index dadbeb6..21afc29 100644
--- a/board/logicpd/zoom2/zoom2.c
+++ b/board/logicpd/zoom2/zoom2.c
@@ -29,6 +29,7 @@
* MA 02111-1307 USA
*/
#include <common.h>
+#include <netdev.h>
#ifdef CONFIG_STATUS_LED
#include <status_led.h>
#endif
@@ -177,3 +178,14 @@ void set_muxconf_regs (void)
/* platform specific muxes */
MUX_ZOOM2 ();
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/lubbock/lubbock.c b/board/lubbock/lubbock.c
index 5829170..d8d6ffb 100644
--- a/board/lubbock/lubbock.c
+++ b/board/lubbock/lubbock.c
@@ -26,6 +26,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -68,3 +69,14 @@ int dram_init (void)
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/ti/omap1510inn/omap1510innovator.c b/board/ti/omap1510inn/omap1510innovator.c
index 8941209..2cb6062 100644
--- a/board/ti/omap1510inn/omap1510innovator.c
+++ b/board/ti/omap1510inn/omap1510innovator.c
@@ -30,6 +30,7 @@
*/
#include <common.h>
+#include <netdev.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -127,3 +128,14 @@ int dram_init (void)
return 0;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/ti/omap1610inn/omap1610innovator.c b/board/ti/omap1610inn/omap1610innovator.c
index 2e04ad4..44818bb 100644
--- a/board/ti/omap1610inn/omap1610innovator.c
+++ b/board/ti/omap1610inn/omap1610innovator.c
@@ -32,6 +32,7 @@
*/
#include <common.h>
+#include <netdev.h>
#if defined(CONFIG_OMAP1610)
#include <./configs/omap1510.h>
#endif
@@ -302,3 +303,14 @@ void peripheral_power_enable (void)
*SW_CLOCK_REQUEST |= UART1_48MHZ_ENABLE;
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/ti/omap2420h4/omap2420h4.c b/board/ti/omap2420h4/omap2420h4.c
index 8d18239..1c98e1b 100644
--- a/board/ti/omap2420h4/omap2420h4.c
+++ b/board/ti/omap2420h4/omap2420h4.c
@@ -22,6 +22,7 @@
* MA 02111-1307 USA
*/
#include <common.h>
+#include <netdev.h>
#include <asm/arch/omap2420.h>
#include <asm/io.h>
#include <asm/arch/bits.h>
@@ -842,3 +843,14 @@ void update_mux(u32 btype,u32 mtype)
}
}
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/ti/omap5912osk/omap5912osk.c b/board/ti/omap5912osk/omap5912osk.c
index 6993b13..cbf451b 100644
--- a/board/ti/omap5912osk/omap5912osk.c
+++ b/board/ti/omap5912osk/omap5912osk.c
@@ -34,6 +34,7 @@
*/
#include <common.h>
+#include <netdev.h>
#if defined(CONFIG_OMAP1610)
#include <./configs/omap1510.h>
#endif
@@ -306,3 +307,14 @@ int checkboard(void)
return (0);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/ti/omap730p2/omap730p2.c b/board/ti/omap730p2/omap730p2.c
index 309d667..954ced5 100644
--- a/board/ti/omap730p2/omap730p2.c
+++ b/board/ti/omap730p2/omap730p2.c
@@ -30,6 +30,7 @@
*/
#include <common.h>
+#include <netdev.h>
#if defined(CONFIG_OMAP730)
#include <./configs/omap730.h>
#endif
@@ -263,3 +264,14 @@ void peripheral_power_enable (void)
*MuxConfReg &= (0xFF1FFFFF);
*MuxConfReg &= (0xF1FFFFFF);
}
+
+#ifdef CONFIG_CMD_NET
+int board_eth_init(bd_t *bis)
+{
+ int rc = 0;
+#ifdef CONFIG_LAN91C96
+ rc = lan91c96_initialize(0, CONFIG_LAN91C96_BASE);
+#endif
+ return rc;
+}
+#endif
diff --git a/board/ti/sdp3430/sdp.c b/board/ti/sdp3430/sdp.c
index 0d8e20d..73db5f1 100644
--- a/board/ti/sdp3430/sdp.c
+++ b/board/ti/sdp3430/sdp.c
@@ -23,6 +23,7 @@
*/
#include <common.h>
#include <netdev.h>
+#include <netdev.h>
#include <twl4030.h>
#include <asm/io.h>
#include <asm/arch/mux.h>
diff --git a/include/configs/B2.h b/include/configs/B2.h
index d7806e9..f51a261 100644
--- a/include/configs/B2.h
+++ b/include/configs/B2.h
@@ -98,7 +98,7 @@
#define CONFIG_CMD_EEPROM
#define CONFIG_CMD_I2C
-
+#define CONFIG_NET_MULTI
#define CONFIG_BOOTDELAY 5
#define CONFIG_ETHADDR 00:50:c2:1e:af:fb
#define CONFIG_BOOTARGS "setenv bootargs root=/dev/ram ip=192.168.0.70:::::eth0:off \
--
1.6.0.4
1
1

14 Dec '09
Current de-assert reset is not sufficient for the USB PHY reset
on some Canyonlands platforms. The patch adds an assert/de-assert
sequence. This addresses a USB detection problem for devices
attached prior to power-up. The delay lengths are needed for
power to the PHY to stabilize.
Signed-off-by: Jeff Mann <MannJ(a)embeddedplanet.com>
Signed-off-by: Dave Mitchell <dmitchell(a)appliedmicro.com>
Acked-by: Tirumala Reddy Marri <tmarri(a)appliedmicro.com>
---
board/amcc/canyonlands/canyonlands.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/board/amcc/canyonlands/canyonlands.c b/board/amcc/canyonlands/canyonlands.c
index 13a0dac..bef12ae 100644
--- a/board/amcc/canyonlands/canyonlands.c
+++ b/board/amcc/canyonlands/canyonlands.c
@@ -177,8 +177,11 @@ int board_early_init_f(void)
/* Remove NOR-FLASH, NAND-FLASH & EEPROM hardware write protection */
out_8((void *)CONFIG_SYS_BCSR_BASE + 5, 0);
- /* Enable USB host & USB-OTG */
+ /* Enable USB host & USB-OTG;force assert,then de-assert PHY reset */
+ out_8((void *)CONFIG_SYS_BCSR_BASE + 7, 1);
+ mdelay(100);
out_8((void *)CONFIG_SYS_BCSR_BASE + 7, 0);
+ mdealy(100);
mtsdr(SDR0_SRST1, 0); /* Pull AHB out of reset default=1 */
--
1.6.3.2
3
4

[U-Boot] [PATCH] Davinci: NAND enable ECC even when not in NAND boot mode
by Nick Thompson 14 Dec '09
by Nick Thompson 14 Dec '09
14 Dec '09
Davinci: NAND enable ECC even when not in NAND boot mode
On Davinci platforms, the default NAND device is enabled (for ECC)
in low level boot code when NAND boot mode is used. If booting in
another mode, NAND ECC is not enabled. The driver should make
sure ECC is enabled regardless of boot mode if NAND is configured
in U-Boot.
Signed-off-by: Nick Thompson <nick.thompson(a)ge.com>
---
Applies to: u-boot-ti
This patch depends on "[PATCH v2] Davinci: Configurable NAND chip selects"
posted on Nov 19, 2009.
drivers/mtd/nand/davinci_nand.c | 2 ++
include/asm-arm/arch-davinci/emif_defs.h | 3 +--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 1ad802a..90e038e 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -87,6 +87,7 @@ static void nand_davinci_enable_hwecc(struct mtd_info *mtd, int mode)
(void)readl(&(emif_regs->NANDFECC[CONFIG_SYS_NAND_CS - 2]));
val = readl(&emif_regs->NANDFCR);
+ val |= DAVINCI_NANDFCR_NAND_ENABLE(CONFIG_SYS_NAND_CS);
val |= DAVINCI_NANDFCR_1BIT_ECC_START(CONFIG_SYS_NAND_CS);
writel(val, &emif_regs->NANDFCR);
}
@@ -219,6 +220,7 @@ static void nand_davinci_4bit_enable_hwecc(struct mtd_info *mtd, int mode)
*/
val = readl(&emif_regs->NANDFCR);
val &= ~DAVINCI_NANDFCR_4BIT_ECC_SEL_MASK;
+ val |= DAVINCI_NANDFCR_NAND_ENABLE(CONFIG_SYS_NAND_CS);
val |= DAVINCI_NANDFCR_4BIT_ECC_SEL(CONFIG_SYS_NAND_CS);
val |= DAVINCI_NANDFCR_4BIT_ECC_START;
writel(val, &emif_regs->NANDFCR);
diff --git a/include/asm-arm/arch-davinci/emif_defs.h b/include/asm-arm/arch-davinci/emif_defs.h
index d67292f..8fd4e01 100644
--- a/include/asm-arm/arch-davinci/emif_defs.h
+++ b/include/asm-arm/arch-davinci/emif_defs.h
@@ -66,11 +66,10 @@ typedef struct {
typedef emif_registers *emifregs;
+#define DAVINCI_NANDFCR_NAND_ENABLE(n) (1 << (n-2))
#define DAVINCI_NANDFCR_4BIT_ECC_SEL_MASK (3 << 4)
#define DAVINCI_NANDFCR_4BIT_ECC_SEL(n) ((n-2) << 4)
-
#define DAVINCI_NANDFCR_1BIT_ECC_START(n) (1 << (8 + (n-2)))
-
#define DAVINCI_NANDFCR_4BIT_ECC_START (1 << 12)
#define DAVINCI_NANDFCR_4BIT_CALC_START (1 << 13)
--
1.6.3.3
2
1
Neither the MVBLUE nor its underlying architecture implement the
do_irqinfo() function which is required when CONFIG_CMD_IRQ is defined.
This change fixes the following MVBLUE compiler error:
-> ./MAKEALL MVBLUE
Configuring for MVBLUE board...
common/libcommon.a(cmd_irq.o):(.u_boot_cmd+0x24): undefined reference to `do_irqinfo'
make: *** [u-boot] Error 1
Signed-off-by: Peter Tyser <ptyser(a)xes-inc.com>
---
include/configs/MVBLUE.h | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/include/configs/MVBLUE.h b/include/configs/MVBLUE.h
index 79c2069..669816c 100644
--- a/include/configs/MVBLUE.h
+++ b/include/configs/MVBLUE.h
@@ -88,7 +88,6 @@
#define CONFIG_CMD_SAVEENV
#define CONFIG_CMD_FLASH
#define CONFIG_CMD_IMI
-#define CONFIG_CMD_IRQ
#define CONFIG_CMD_NET
#define CONFIG_CMD_PCI
#define CONFIG_CMD_RUN
--
1.6.2-rc2.GIT
3
2