Add generic support for samsung s3c2440
This patch adds generic support for the Samsung s3c2440 processor.
Global s3c24x0 changes to struct members converting from upper case to
lower case.
Signed-off-by: Craig Nauman <cnauman@diagraph.com>
Cc: kevin.morfitt@fearnside-systems.co.uk
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
diff --git a/board/trab/trab.c b/board/trab/trab.c
index 828facd..0f74e8f 100644
--- a/board/trab/trab.c
+++ b/board/trab/trab.c
@@ -77,36 +77,36 @@
#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;
+ clk_power->mpllcon = 0x5c042;
+ clk_power->clkdivn = 0;
#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;
+ clk_power->mpllcon = 0x7d041;
+ clk_power->clkdivn = 3;
#endif
/* set up the I/O ports */
- gpio->PACON = 0x3ffff;
- gpio->PBCON = 0xaaaaaaaa;
- gpio->PBUP = 0xffff;
+ gpio->pacon = 0x3ffff;
+ gpio->pbcon = 0xaaaaaaaa;
+ gpio->pbup = 0xffff;
/* 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);
+ gpio->pfcon = (2<<0) | (2<<2) | (2<<4) | (2<<6) | (2<<8) | (2<<10);
#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);
+ gpio->pfup = (1<<0) | (1<<1) | (1<<2) | (1<<3) | (1<<4) | (1<<5);
#else
/* do not pull up RXD0, RXD1, TXD0, TXD1 */
- gpio->PFUP = (1<<0) | (1<<1) | (1<<2) | (1<<3);
+ gpio->pfup = (1<<0) | (1<<1) | (1<<2) | (1<<3);
#endif
- gpio->PGCON = 0x0;
- gpio->PGUP = 0x0;
- gpio->OPENCR= 0x0;
+ gpio->pgcon = 0x0;
+ gpio->pgup = 0x0;
+ gpio->opencr = 0x0;
/* suppress flicker of the VFDs */
- gpio->MISCCR = 0x40;
- gpio->PFCON |= (2<<12);
+ gpio->misccr = 0x40;
+ gpio->pfcon |= (2<<12);
gd->bd->bi_arch_number = MACH_TYPE_TRAB;
@@ -114,8 +114,8 @@
gd->bd->bi_boot_params = 0x0c000100;
/* Make sure both buzzers are turned off */
- gpio->PDCON |= 0x5400;
- gpio->PDDAT &= ~0xE0;
+ gpio->pdcon |= 0x5400;
+ gpio->pddat &= ~0xE0;
#ifdef CONFIG_VFD
vfd_init_clocks();
@@ -132,7 +132,7 @@
#ifdef CONFIG_DRIVER_S3C24X0_I2C
/* Configure I/O ports PG5 und PG6 for I2C */
- gpio->PGCON = (gpio->PGCON & 0x003c00) | 0x003c00;
+ gpio->pgcon = (gpio->pgcon & 0x003c00) | 0x003c00;
#endif /* CONFIG_DRIVER_S3C24X0_I2C */
return 0;
@@ -341,14 +341,14 @@
{
struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
- gpio->PDDAT &= 0x5FF;
+ gpio->pddat &= 0x5FF;
}
static inline void CLR_CS_TOUCH(void)
{
struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
- gpio->PDDAT |= 0x200;
+ gpio->pddat |= 0x200;
}
static void spi_init(void)
@@ -358,20 +358,20 @@
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;
+ gpio->pdcon = (gpio->pdcon & 0xF3FFFF) | 0x040000;
+ gpio->pgcon = (gpio->pgcon & 0x0F3FFF) | 0x008000;
+ gpio->pgcon = (gpio->pgcon & 0x0CFFFF) | 0x020000;
+ gpio->pgcon = (gpio->pgcon & 0x03FFFF) | 0x080000;
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 */
+ 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, Prescale, Master, CPOL=0, CPHA=1 */
/* Dummy byte ensures clock to be low. */
for (i = 0; i < 10; i++) {
- spi->ch[0].SPTDAT = 0xFF;
+ spi->ch[0].sptdat = 0xFF;
}
wait_transmit_done();
}
@@ -380,7 +380,8 @@
{
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 */
+ ;
}
static void tsc2000_write(unsigned int page, unsigned int reg,
@@ -394,13 +395,13 @@
command |= (page << 11);
command |= (reg << 5);
- spi->ch[0].SPTDAT = (command & 0xFF00) >> 8;
+ spi->ch[0].sptdat = (command & 0xFF00) >> 8;
wait_transmit_done();
- spi->ch[0].SPTDAT = (command & 0x00FF);
+ spi->ch[0].sptdat = (command & 0x00FF);
wait_transmit_done();
- spi->ch[0].SPTDAT = (data & 0xFF00) >> 8;
+ spi->ch[0].sptdat = (data & 0xFF00) >> 8;
wait_transmit_done();
- spi->ch[0].SPTDAT = (data & 0x00FF);
+ spi->ch[0].sptdat = (data & 0x00FF);
wait_transmit_done();
CLR_CS_TOUCH();