Skip to contentSkip to conversation

s3c4510b: move specific code to soc directory

PATCH New Jean-Christophe PLAGNIOL-VILLARD 2 participants 20 messages Mar 29, 2009 – Mar 30, 2009

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

PATCH 1/19 s3c4510b: move specific code to soc directory

---
 Makefile                                           |    2 +-
 cpu/arm720t/cpu.c                                  |   62 --------------
 cpu/arm720t/s3c4510b/Makefile                      |   46 +++++++++++
 cpu/arm720t/s3c4510b/cache.c                       |   86 ++++++++++++++++++++
 include/asm-arm/arch-arm720t/hardware.h            |    4 +-
 .../s3c4510b.h => arch-s3c4510b/hardware.h}        |    0
 6 files changed, 134 insertions(+), 66 deletions(-)
 create mode 100644 cpu/arm720t/s3c4510b/Makefile
 create mode 100644 cpu/arm720t/s3c4510b/cache.c
 rename include/asm-arm/{arch-arm720t/s3c4510b.h => arch-s3c4510b/hardware.h} (100%)
Makefile +1 -1
index 1cce381..a6dadf6 100644
@@ -2943,7 +2943,7 @@ modnet50_config :	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm720t modnet50
 
 evb4510_config :	unconfig
-	@$(MKCONFIG) $(@:_config=) arm arm720t evb4510
+	@$(MKCONFIG) $(@:_config=) arm arm720t evb4510 NULL s3c4510b
 
 lpc2292sodimm_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm720t lpc2292sodimm NULL lpc2292
cpu/arm720t/cpu.c +0 -62

71 lines not on this page · raw message

cpu/arm720t/s3c4510b/Makefile new file +46 -0

46 lines not on this page · raw message

cpu/arm720t/s3c4510b/cache.c new file +86 -0

86 lines not on this page · raw message

include/asm-arm/arch-arm720t/hardware.h +1 -3
index 3056ca7..ec053c9 100644
@@ -24,9 +24,7 @@
  * MA 02111-1307 USA
  */
 
-#if defined(CONFIG_S3C4510B)
-#include <asm-arm/arch-arm720t/s3c4510b.h>
-#elif defined(CONFIG_NETARM)
+#if defined(CONFIG_NETARM)
 #include <asm-arm/arch-arm720t/netarm_registers.h>
 #elif defined(CONFIG_IMPA7)
 /* include IMPA7 specific hardware file if there was one */
include/asm-arm/arch-s3c4510b/hardware.h renamed from include/asm-arm/arch-arm720t/s3c4510b.h +0 -0
similarity index 100%
rename from include/asm-arm/arch-arm720t/s3c4510b.h
rename to include/asm-arm/arch-s3c4510b/hardware.h
Signature · 1 line
1.6.2.1
#1 lore raw

PATCH 2/19 s3c44b0: move i2c driver to drivers/i2c

---
 cpu/s3c44b0/cpu.c                              |  735 +++++++-----------------
 drivers/i2c/Makefile                           |    1 +
 cpu/s3c44b0/cpu.c => drivers/i2c/s3c44b0_i2c.c |  198 -------
 include/configs/B2.h                           |    2 +
 4 files changed, 225 insertions(+), 711 deletions(-)
 rewrite cpu/s3c44b0/cpu.c (60%)
 rename cpu/s3c44b0/cpu.c => drivers/i2c/s3c44b0_i2c.c (70%)
cpu/s3c44b0/cpu.c +222 -513
dissimilarity index 60%
index 2960f2f..0c44691 100644
@@ -1,513 +1,222 @@
-/*
- * (C) Copyright 2004
- * DAVE Srl
- * http://www.dave-tech.it
- * http://www.wawnet.biz
- * mailto:info at wawnet.biz
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-/*
- * S3C44B0 CPU specific code
- */
-
-#include <common.h>
-#include <command.h>
-#include <asm/hardware.h>
-
-static void s3c44b0_flush_cache(void)
-{
-	volatile int i;
-	/* flush cycle */
-	for(i=0x10002000;i<0x10004800;i+=16)
-	{
-		*((int *)i)=0x0;
-	}
-}
-
-
-int cpu_init (void)
-{
-	icache_enable();
-
-	return 0;
-}
-
-int cleanup_before_linux (void)
-{
-	/*
-		cache memory should be enabled before calling
-		Linux to make the kernel uncompression faster
-	*/
-	icache_enable();
-
-	disable_interrupts ();
-
-	return 0;
-}
-
-void reset_cpu (ulong addr)
-{
-	/*
-		reset the cpu using watchdog
-	*/
-
-	/* Disable the watchdog.*/
-	WTCON&=~(1<<5);
-
-	/* set the timeout value to a short time... */
-	WTCNT = 0x1;
-
-	/* Enable the watchdog. */
-	WTCON|=1;
-	WTCON|=(1<<5);
-
-	while(1) {
-		/*NOP*/
-	}
-}
-
-int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-	disable_interrupts ();
-	reset_cpu (0);
-
-	/*NOTREACHED*/
-	return (0);
-}
-
-void icache_enable (void)
-{
-	ulong reg;
-
-	s3c44b0_flush_cache();
-
-	/*
-		Init cache
-		Non-cacheable area (everything outside RAM)
-		0x0000:0000 - 0x0C00:0000
-	 */
-	NCACHBE0 = 0xC0000000;
-	NCACHBE1 = 0x00000000;
-
-	/*
-		Enable chache
-	*/
-	reg = SYSCFG;
-	reg |= 0x00000006; /* 8kB */
-	SYSCFG = reg;
-}
-
-void icache_disable (void)
-{
-	ulong reg;
-
-	reg = SYSCFG;
-	reg &= ~0x00000006; /* 8kB */
-	SYSCFG = reg;
-}
-
-int icache_status (void)
-{
-	return 0;
-}
-
-void dcache_enable (void)
-{
-	icache_enable();
-}
-
-void dcache_disable (void)
-{
-	icache_disable();
-}
-
-int dcache_status (void)
-{
-	return dcache_status();
-}
-
-/*
-	RTC stuff
-*/
-#include <rtc.h>
-#ifndef BCD2HEX
-	#define BCD2HEX(n)  ((n>>4)*10+(n&0x0f))
-#endif
-#ifndef HEX2BCD
-	#define HEX2BCD(x) ((((x) / 10) << 4) + (x) % 10)
-#endif
-
-int rtc_get (struct rtc_time* tm)
-{
-	RTCCON |= 1;
-	tm->tm_year  = BCD2HEX(BCDYEAR);
-	tm->tm_mon   = BCD2HEX(BCDMON);
-	tm->tm_wday   = BCD2HEX(BCDDATE);
-	tm->tm_mday   = BCD2HEX(BCDDAY);
-	tm->tm_hour  = BCD2HEX(BCDHOUR);
-	tm->tm_min  = BCD2HEX(BCDMIN);
-	tm->tm_sec  = BCD2HEX(BCDSEC);
-
-	if (tm->tm_sec==0) {
-		/* we have to re-read the rtc data because of the "one second deviation" problem */
-		/* see RTC datasheet for more info about it */
-		tm->tm_year  = BCD2HEX(BCDYEAR);
-		tm->tm_mon   = BCD2HEX(BCDMON);
-		tm->tm_mday   = BCD2HEX(BCDDAY);
-		tm->tm_wday   = BCD2HEX(BCDDATE);
-		tm->tm_hour  = BCD2HEX(BCDHOUR);
-		tm->tm_min  = BCD2HEX(BCDMIN);
-		tm->tm_sec  = BCD2HEX(BCDSEC);
-	}
-
-	RTCCON &= ~1;
-
-	if(tm->tm_year >= 70)
-		tm->tm_year += 1900;
-	else
-		tm->tm_year += 2000;
-
-	return 0;
-}
-
-int rtc_set (struct rtc_time* tm)
-{
-	if(tm->tm_year < 2000)
-		tm->tm_year -= 1900;
-	else
-		tm->tm_year -= 2000;
-
-	RTCCON |= 1;
-	BCDYEAR = HEX2BCD(tm->tm_year);
-	BCDMON = HEX2BCD(tm->tm_mon);
-	BCDDAY = HEX2BCD(tm->tm_mday);
-	BCDDATE = HEX2BCD(tm->tm_wday);
-	BCDHOUR = HEX2BCD(tm->tm_hour);
-	BCDMIN = HEX2BCD(tm->tm_min);
-	BCDSEC = HEX2BCD(tm->tm_sec);
-	RTCCON &= 1;
-
-	return 0;
-}
-
-void rtc_reset (void)
-{
-	RTCCON |= 1;
-	BCDYEAR = 0;
-	BCDMON = 0;
-	BCDDAY = 0;
-	BCDDATE = 0;
-	BCDHOUR = 0;
-	BCDMIN = 0;
-	BCDSEC = 0;
-	RTCCON &= 1;
-}
-
-
-/*
-	I2C stuff
-*/
-
-/*
- * Initialization, must be called once on start up, may be called
- * repeatedly to change the speed and slave addresses.
- */
-void i2c_init(int speed, int slaveaddr)
-{
-	/*
-		setting up I2C support
-	*/
-	unsigned int save_F,save_PF,rIICCON,rPCONA,rPDATA,rPCONF,rPUPF;
-
-	save_F = PCONF;
-	save_PF = PUPF;
-
-	rPCONF = ((save_F & ~(0xF))| 0xa);
-	rPUPF = (save_PF | 0x3);
-	PCONF = rPCONF; /*PF0:IICSCL, PF1:IICSDA*/
-	PUPF = rPUPF; /* Disable pull-up */
-
-	/* Configuring pin for WC pin of EEprom */
-	rPCONA = PCONA;
-	rPCONA &= ~(1<<9);
-	PCONA = rPCONA;
-
-	rPDATA = PDATA;
-	rPDATA &= ~(1<<9);
-	PDATA = rPDATA;
-
-	/*
-		Enable ACK, IICCLK=MCLK/16, enable interrupt
-		75MHz/16/(12+1) = 390625 Hz
-	*/
-	rIICCON=(1<<7)|(0<<6)|(1<<5)|(0xC);
-	IICCON = rIICCON;
-
-	IICADD = slaveaddr;
-}
-
-/*
- * Probe the given I2C chip address.  Returns 0 if a chip responded,
- * not 0 on failure.
- */
-int i2c_probe(uchar chip)
-{
-	/*
-		not implemented
-	*/
-
-	printf("i2c_probe chip %d\n", (int) chip);
-	return -1;
-}
-
-/*
- * Read/Write interface:
- *   chip:    I2C chip address, range 0..127
- *   addr:    Memory (register) address within the chip
- *   alen:    Number of bytes to use for addr (typically 1, 2 for larger
- *              memories, 0 for register type devices with only one
- *              register)
- *   buffer:  Where to read/write the data
- *   len:     How many bytes to read/write
- *
- *   Returns: 0 on success, not 0 on failure
- */
-
-#define S3C44B0X_rIIC_INTPEND               (1<<4)
-#define S3C44B0X_rIIC_LAST_RECEIV_BIT       (1<<0)
-#define S3C44B0X_rIIC_INTERRUPT_ENABLE      (1<<5)
-#define S3C44B0_IIC_TIMEOUT 100
-
-int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len)
-{
-
-	int k, j, temp;
-	u32 rIICSTAT;
-
-	/*
-		send the device offset
-	*/
-
-	rIICSTAT = 0xD0;
-	IICSTAT = rIICSTAT;
-
-	IICDS = chip;	/* this is a write operation... */
-
-	rIICSTAT |= (1<<5);
-	IICSTAT = rIICSTAT;
-
-	for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-		temp = IICCON;
-		if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-		break;
-		udelay(2000);
-	}
-	if (k==S3C44B0_IIC_TIMEOUT)
-		return -1;
-
-	/* wait and check ACK */
-	temp = IICSTAT;
-	if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-		return -1;
-
-	IICDS = addr;
-	IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-
-	/* wait and check ACK */
-	for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-		temp = IICCON;
-		if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-		break;
-		udelay(2000);
-	}
-	if (k==S3C44B0_IIC_TIMEOUT)
-		return -1;
-
-	temp = IICSTAT;
-	if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-		return -1;
-
-	/*
-		now we can start with the read operation...
-	*/
-
-	IICDS = chip | 0x01;	/* this is a read operation... */
-
-	rIICSTAT = 0x90; /*master recv*/
-	rIICSTAT |= (1<<5);
-	IICSTAT = rIICSTAT;
-
-	IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-
-	/* wait and check ACK */
-	for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-		temp = IICCON;
-		if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-		break;
-		udelay(2000);
-	}
-	if (k==S3C44B0_IIC_TIMEOUT)
-		return -1;
-
-	temp = IICSTAT;
-	if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-		return -1;
-
-	for (j=0; j<len-1; j++) {
-
-	/*clear pending bit to resume */
-
-	temp = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-	IICCON = temp;
-
-	/* wait and check ACK */
-	for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-		temp = IICCON;
-		if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-		break;
-		udelay(2000);
-	}
-	if (k==S3C44B0_IIC_TIMEOUT)
-		return -1;
-
-
-		buffer[j] = IICDS; /*save readed data*/
-
-    } /*end for(j)*/
-
-	/*
-		reading the last data
-		unset ACK generation
-	*/
-	temp = IICCON & ~(S3C44B0X_rIIC_INTPEND | (1<<7));
-	IICCON = temp;
-
-	/* wait but NOT check ACK */
-	for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-		temp = IICCON;
-		if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-		break;
-		udelay(2000);
-	}
-	if (k==S3C44B0_IIC_TIMEOUT)
-		return -1;
-
-	buffer[j] = IICDS; /*save readed data*/
-
-	rIICSTAT = 0x90; /*master recv*/
-
-	/* Write operation Terminate sending STOP */
-	IICSTAT = rIICSTAT;
-	/*Clear Int Pending Bit to RESUME*/
-	temp = IICCON;
-	IICCON = temp & (~S3C44B0X_rIIC_INTPEND);
-
-	IICCON = IICCON | (1<<7);	/*restore ACK generation*/
-
-	return 0;
-}
-
-int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
-{
-	int j, k;
-	u32 rIICSTAT, temp;
-
-
-	/*
-		send the device offset
-	*/
-
-	rIICSTAT = 0xD0;
-	IICSTAT = rIICSTAT;
-
-	IICDS = chip;	/* this is a write operation... */
-
-	rIICSTAT |= (1<<5);
-	IICSTAT = rIICSTAT;
-
-	IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-
-	/* wait and check ACK */
-	for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-		temp = IICCON;
-		if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-		break;
-		udelay(2000);
-	}
-	if (k==S3C44B0_IIC_TIMEOUT)
-		return -1;
-
-	temp = IICSTAT;
-	if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-		return -1;
-
-	IICDS = addr;
-	IICCON = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-
-	/* wait and check ACK */
-	for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-		temp = IICCON;
-		if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-		break;
-		udelay(2000);
-	}
-	if (k==S3C44B0_IIC_TIMEOUT)
-	  return -1;
-
-	temp = IICSTAT;
-	if ((temp & S3C44B0X_rIIC_LAST_RECEIV_BIT) == S3C44B0X_rIIC_LAST_RECEIV_BIT )
-		return -1;
-
-	/*
-		now we can start with the read write operation
-	*/
-	for (j=0; j<len; j++) {
-
-		IICDS = buffer[j]; /*prerare data to write*/
-
-		/*clear pending bit to resume*/
-
-		temp = IICCON & ~(S3C44B0X_rIIC_INTPEND);
-		IICCON = temp;
-
-		/* wait but NOT check ACK */
-		for(k=0; k<S3C44B0_IIC_TIMEOUT; k++) {
-			temp = IICCON;
-			if( (temp & S3C44B0X_rIIC_INTPEND) == S3C44B0X_rIIC_INTPEND)
-			break;
-
-			udelay(2000);
-		}
-
-		if (k==S3C44B0_IIC_TIMEOUT)
-			return -1;
-
-	} /* end for(j) */
-
-	/* sending stop to terminate */
-	rIICSTAT = 0xD0;  /*master send*/
-	IICSTAT = rIICSTAT;
-	/*Clear Int Pending Bit to RESUME*/
-	temp = IICCON;
-	IICCON = temp & (~S3C44B0X_rIIC_INTPEND);
-
-	return 0;
-}
+/*
+ * (C) Copyright 2004
+ * DAVE Srl
+ * http://www.dave-tech.it
+ * http://www.wawnet.biz
+ * mailto:[email protected]
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/*
+ * S3C44B0 CPU specific code
+ */
+
+#include <common.h>
+#include <command.h>
+#include <asm/hardware.h>
+
+static void s3c44b0_flush_cache(void)
+{
+	volatile int i;
+	/* flush cycle */
+	for(i=0x10002000;i<0x10004800;i+=16)
+	{
+		*((int *)i)=0x0;
+	}
+}
+
+
+int cpu_init (void)
+{
+	icache_enable();
+
+	return 0;
+}
+
+int cleanup_before_linux (void)
+{
+	/*
+		cache memory should be enabled before calling
+		Linux to make the kernel uncompression faster
+	*/
+	icache_enable();
+
+	disable_interrupts ();
+
+	return 0;
+}
+
+void reset_cpu (ulong addr)
+{
+	/*
+		reset the cpu using watchdog
+	*/
+
+	/* Disable the watchdog.*/
+	WTCON&=~(1<<5);
+
+	/* set the timeout value to a short time... */
+	WTCNT = 0x1;
+
+	/* Enable the watchdog. */
+	WTCON|=1;
+	WTCON|=(1<<5);
+
+	while(1) {
+		/*NOP*/
+	}
+}
+
+int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+	disable_interrupts ();
+	reset_cpu (0);
+
+	/*NOTREACHED*/
+	return (0);
+}
+
+void icache_enable (void)
+{
+	ulong reg;
+
+	s3c44b0_flush_cache();
+
+	/*
+		Init cache
+		Non-cacheable area (everything outside RAM)
+		0x0000:0000 - 0x0C00:0000
+	 */
+	NCACHBE0 = 0xC0000000;
+	NCACHBE1 = 0x00000000;
+
+	/*
+		Enable chache
+	*/
+	reg = SYSCFG;
+	reg |= 0x00000006; /* 8kB */
+	SYSCFG = reg;
+}
+
+void icache_disable (void)
+{
+	ulong reg;
+
+	reg = SYSCFG;
+	reg &= ~0x00000006; /* 8kB */
+	SYSCFG = reg;
+}
+
+int icache_status (void)
+{
+	return 0;
+}
+
+void dcache_enable (void)
+{
+	icache_enable();
+}
+
+void dcache_disable (void)
+{
+	icache_disable();
+}
+
+int dcache_status (void)
+{
+	return dcache_status();
+}
+
+/*
+	RTC stuff
+*/
+#include <rtc.h>
+#ifndef BCD2HEX
+	#define BCD2HEX(n)  ((n>>4)*10+(n&0x0f))
+#endif
+#ifndef HEX2BCD
+	#define HEX2BCD(x) ((((x) / 10) << 4) + (x) % 10)
+#endif
+
+int rtc_get (struct rtc_time* tm)
+{
+	RTCCON |= 1;
+	tm->tm_year  = BCD2HEX(BCDYEAR);
+	tm->tm_mon   = BCD2HEX(BCDMON);
+	tm->tm_wday   = BCD2HEX(BCDDATE);
+	tm->tm_mday   = BCD2HEX(BCDDAY);
+	tm->tm_hour  = BCD2HEX(BCDHOUR);
+	tm->tm_min  = BCD2HEX(BCDMIN);
+	tm->tm_sec  = BCD2HEX(BCDSEC);
+
+	if (tm->tm_sec==0) {
+		/* we have to re-read the rtc data because of the "one second deviation" problem */
+		/* see RTC datasheet for more info about it */
+		tm->tm_year  = BCD2HEX(BCDYEAR);
+		tm->tm_mon   = BCD2HEX(BCDMON);
+		tm->tm_mday   = BCD2HEX(BCDDAY);
+		tm->tm_wday   = BCD2HEX(BCDDATE);
+		tm->tm_hour  = BCD2HEX(BCDHOUR);
+		tm->tm_min  = BCD2HEX(BCDMIN);
+		tm->tm_sec  = BCD2HEX(BCDSEC);
+	}
+
+	RTCCON &= ~1;
+
+	if(tm->tm_year >= 70)
+		tm->tm_year += 1900;
+	else
+		tm->tm_year += 2000;
+
+	return 0;
+}
+
+int rtc_set (struct rtc_time* tm)
+{
+	if(tm->tm_year < 2000)
+		tm->tm_year -= 1900;
+	else
+		tm->tm_year -= 2000;
+
+	RTCCON |= 1;
+	BCDYEAR = HEX2BCD(tm->tm_year);
+	BCDMON = HEX2BCD(tm->tm_mon);
+	BCDDAY = HEX2BCD(tm->tm_mday);
+	BCDDATE = HEX2BCD(tm->tm_wday);
+	BCDHOUR = HEX2BCD(tm->tm_hour);
+	BCDMIN = HEX2BCD(tm->tm_min);
+	BCDSEC = HEX2BCD(tm->tm_sec);
+	RTCCON &= 1;
+
+	return 0;
+}
+
+void rtc_reset (void)
+{
+	RTCCON |= 1;
+	BCDYEAR = 0;
+	BCDMON = 0;
+	BCDDAY = 0;
+	BCDDATE = 0;
+	BCDHOUR = 0;
+	BCDMIN = 0;
+	BCDSEC = 0;
+	RTCCON &= 1;
+}
drivers/i2c/Makefile +1 -0
index 9c74657..69cf9a6 100644
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
+COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
 COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 
drivers/i2c/s3c44b0_i2c.c renamed from cpu/s3c44b0/cpu.c +0 -198

208 lines not on this page · raw message

include/configs/B2.h +2 -0
index 340b847..d9f6e14 100644
@@ -67,6 +67,8 @@
  */
 #define CONFIG_SERIAL1		1	/* we use Serial line 1 */
 
+#define CONFIG_S3C44B0_I2C
+
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
 
Signature · 1 line
1.6.2.1
#2 lore raw

PATCH 3/19 s3c44b0: move rtc driver to drivers/rtc

---
 cpu/s3c44b0/cpu.c         |   77 ----------------------------------
 drivers/rtc/Makefile      |    1 +
 drivers/rtc/s3c44b0_rtc.c |  102 +++++++++++++++++++++++++++++++++++++++++++++
 include/configs/B2.h      |    1 +
 4 files changed, 104 insertions(+), 77 deletions(-)
 create mode 100644 drivers/rtc/s3c44b0_rtc.c
cpu/s3c44b0/cpu.c +0 -77
index 0c44691..752191d 100644
@@ -143,80 +143,3 @@ int dcache_status (void)
 {
 	return dcache_status();
 }
-
-/*
-	RTC stuff
-*/
-#include <rtc.h>
-#ifndef BCD2HEX
-	#define BCD2HEX(n)  ((n>>4)*10+(n&0x0f))
-#endif
-#ifndef HEX2BCD
-	#define HEX2BCD(x) ((((x) / 10) << 4) + (x) % 10)
-#endif
-
-int rtc_get (struct rtc_time* tm)
-{
-	RTCCON |= 1;
-	tm->tm_year  = BCD2HEX(BCDYEAR);
-	tm->tm_mon   = BCD2HEX(BCDMON);
-	tm->tm_wday   = BCD2HEX(BCDDATE);
-	tm->tm_mday   = BCD2HEX(BCDDAY);
-	tm->tm_hour  = BCD2HEX(BCDHOUR);
-	tm->tm_min  = BCD2HEX(BCDMIN);
-	tm->tm_sec  = BCD2HEX(BCDSEC);
-
-	if (tm->tm_sec==0) {
-		/* we have to re-read the rtc data because of the "one second deviation" problem */
-		/* see RTC datasheet for more info about it */
-		tm->tm_year  = BCD2HEX(BCDYEAR);
-		tm->tm_mon   = BCD2HEX(BCDMON);
-		tm->tm_mday   = BCD2HEX(BCDDAY);
-		tm->tm_wday   = BCD2HEX(BCDDATE);
-		tm->tm_hour  = BCD2HEX(BCDHOUR);
-		tm->tm_min  = BCD2HEX(BCDMIN);
-		tm->tm_sec  = BCD2HEX(BCDSEC);
-	}
-
-	RTCCON &= ~1;
-
-	if(tm->tm_year >= 70)
-		tm->tm_year += 1900;
-	else
-		tm->tm_year += 2000;
-
-	return 0;
-}
-
-int rtc_set (struct rtc_time* tm)
-{
-	if(tm->tm_year < 2000)
-		tm->tm_year -= 1900;
-	else
-		tm->tm_year -= 2000;
-
-	RTCCON |= 1;
-	BCDYEAR = HEX2BCD(tm->tm_year);
-	BCDMON = HEX2BCD(tm->tm_mon);
-	BCDDAY = HEX2BCD(tm->tm_mday);
-	BCDDATE = HEX2BCD(tm->tm_wday);
-	BCDHOUR = HEX2BCD(tm->tm_hour);
-	BCDMIN = HEX2BCD(tm->tm_min);
-	BCDSEC = HEX2BCD(tm->tm_sec);
-	RTCCON &= 1;
-
-	return 0;
-}
-
-void rtc_reset (void)
-{
-	RTCCON |= 1;
-	BCDYEAR = 0;
-	BCDMON = 0;
-	BCDDAY = 0;
-	BCDDATE = 0;
-	BCDHOUR = 0;
-	BCDMIN = 0;
-	BCDSEC = 0;
-	RTCCON &= 1;
-}
drivers/rtc/Makefile +1 -0
index 94bc518..3831dd9 100644
@@ -57,6 +57,7 @@ COBJS-$(CONFIG_RTC_PL031) += pl031.o
 COBJS-$(CONFIG_RTC_RS5C372A) += rs5c372.o
 COBJS-$(CONFIG_RTC_RX8025) += rx8025.o
 COBJS-$(CONFIG_RTC_S3C24X0) += s3c24x0_rtc.o
+COBJS-$(CONFIG_RTC_S3C44B0) += s3c44b0_rtc.o
 COBJS-$(CONFIG_RTC_X1205) += x1205.o
 
 COBJS	:= $(sort $(COBJS-y))
drivers/rtc/s3c44b0_rtc.c new file +102 -0

102 lines not on this page · raw message

include/configs/B2.h +1 -0
index d9f6e14..9340db6 100644
@@ -68,6 +68,7 @@
 #define CONFIG_SERIAL1		1	/* we use Serial line 1 */
 
 #define CONFIG_S3C44B0_I2C
+#define CONFIG_RTC_S3C44B0
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
Signature · 1 line
1.6.2.1
#3 lore raw

PATCH 4/19 s3c44b0: move serial driver to drivers/serial

---
 cpu/s3c44b0/Makefile                               |    2 +-
 drivers/serial/Makefile                            |    1 +
 .../serial.c => drivers/serial/serial_s3c44b0.c    |    0
 include/configs/B2.h                               |    1 +
 4 files changed, 3 insertions(+), 1 deletions(-)
 rename cpu/s3c44b0/serial.c => drivers/serial/serial_s3c44b0.c (100%)
cpu/s3c44b0/Makefile +1 -1
index 790faeb..fd696f7 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
-COBJS	= serial.o interrupts.o cpu.o
+COBJS	= interrupts.o cpu.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
drivers/serial/Makefile +1 -0
index d0efd73..37cc5a0 100644
@@ -37,6 +37,7 @@ COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
+COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
drivers/serial/serial_s3c44b0.c renamed from cpu/s3c44b0/serial.c +0 -0
similarity index 100%
rename from cpu/s3c44b0/serial.c
rename to drivers/serial/serial_s3c44b0.c
include/configs/B2.h +1 -0
index 9340db6..01b65c5 100644
@@ -65,6 +65,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C44B0_SERIAL
 #define CONFIG_SERIAL1		1	/* we use Serial line 1 */
 
 #define CONFIG_S3C44B0_I2C
Signature · 1 line
1.6.2.1
#4 lore raw

PATCH 5/19 s3c44b0: extract cache from cpu.c

---
 cpu/s3c44b0/Makefile           |    2 +-
 cpu/s3c44b0/{cpu.c => cache.c} |   56 +-----------------------------------
 cpu/s3c44b0/cpu.c              |   62 ----------------------------------------
 3 files changed, 2 insertions(+), 118 deletions(-)
 copy cpu/s3c44b0/{cpu.c => cache.c} (71%)
cpu/s3c44b0/Makefile +1 -1
index fd696f7..ae909a6 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
-COBJS	= interrupts.o cpu.o
+COBJS	= cache.o cpu.o interrupts.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
cpu/s3c44b0/cache.c renamed from cpu/s3c44b0/cpu.c +1 -55

71 lines not on this page · raw message

cpu/s3c44b0/cpu.c +0 -62

71 lines not on this page · raw message

Signature · 1 line
1.6.2.1
#5 lore raw

PATCH 6/19 sa1100: move serial driver to drivers/serial

add CONFIG_SA1100_SERIAL to activate the driver

---
 cpu/sa1100/Makefile                                |    2 +-
 drivers/serial/Makefile                            |    1 +
 .../serial.c => drivers/serial/serial_sa1100.c     |    0
 include/configs/assabet.h                          |    1 +
 include/configs/dnp1110.h                          |    1 +
 include/configs/gcplus.h                           |    1 +
 include/configs/lart.h                             |    1 +
 include/configs/shannon.h                          |    1 +
 8 files changed, 7 insertions(+), 1 deletions(-)
 rename cpu/sa1100/serial.c => drivers/serial/serial_sa1100.c (100%)
cpu/sa1100/Makefile +1 -1
index 790faeb..fd696f7 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
-COBJS	= serial.o interrupts.o cpu.o
+COBJS	= interrupts.o cpu.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
drivers/serial/Makefile +1 -0
index 37cc5a0..8cac794 100644
@@ -37,6 +37,7 @@ COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
+COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
 COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
drivers/serial/serial_sa1100.c renamed from cpu/sa1100/serial.c +0 -0
similarity index 100%
rename from cpu/sa1100/serial.c
rename to drivers/serial/serial_sa1100.c
include/configs/assabet.h +1 -0
index 4da68b3..a6c442b 100644
@@ -57,6 +57,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL1          1	/* we use SERIAL 1 on Intel Assabet */
 
 /* allow to overwrite serial and ethaddr */
include/configs/dnp1110.h +1 -0
index 3f658a7..8f615bd 100644
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL1          1	/* we use SERIAL 1 */
 
 /* allow to overwrite serial and ethaddr */
include/configs/gcplus.h +1 -0
index 81ee05f..77d4578 100644
@@ -70,6 +70,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL3          1	/* we use SERIAL 3 on ADS GCPlus */
 
 /* allow to overwrite serial and ethaddr */
include/configs/lart.h +1 -0
index 877d5c7..e34ec22 100644
@@ -52,6 +52,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL3          1	/* we use SERIAL 3 on LART */
 
 /* allow to overwrite serial and ethaddr */
include/configs/shannon.h +1 -0
index 717036c..c8b0b16 100644
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_SA1100_SERIAL
 #define CONFIG_SERIAL3          1	/* we use SERIAL 3  */
 
 /* allow to overwrite serial and ethaddr */
Signature · 1 line
1.6.2.1
#6 lore raw

PATCH 7/19 netarm: move serial driver to drivers/serial

add CONFIG_NETARM_SERIAL to activate the driver

---
 cpu/arm720t/Makefile                            |    2 +-
 drivers/serial/Makefile                         |    1 +
 {cpu/arm720t => drivers/serial}/serial_netarm.c |    5 -----
 include/configs/modnet50.h                      |    1 +
 4 files changed, 3 insertions(+), 6 deletions(-)
 rename {cpu/arm720t => drivers/serial}/serial_netarm.c (99%)
cpu/arm720t/Makefile +1 -1
index c97f329..a038042 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
-COBJS	= serial.o serial_netarm.o interrupts.o cpu.o
+COBJS	= serial.o interrupts.o cpu.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
drivers/serial/Makefile +1 -0
index 8cac794..e76a2ad 100644
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
+COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
drivers/serial/serial_netarm.c renamed from cpu/arm720t/serial_netarm.c +0 -5
similarity index 99%
rename from cpu/arm720t/serial_netarm.c
rename to drivers/serial/serial_netarm.c
index 1a1b2db..2eb5393 100644
@@ -29,9 +29,6 @@
  */
 
 #include <common.h>
-
-#ifdef CONFIG_NETARM
-
 #include <asm/hardware.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -196,5 +193,3 @@ void serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-
-#endif /* CONFIG_NETARM */
include/configs/modnet50.h +1 -0
index b8ae018..74bab5f 100644
@@ -56,6 +56,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_NETARM_SERIAL
 #define CONFIG_SERIAL1		1	/* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
Signature · 1 line
1.6.2.1
#7 lore raw

PATCH 8/19 imx31: move serial driver to drivers/serial

---
 cpu/arm1136/mx31/Makefile                          |    2 +-
 drivers/serial/Makefile                            |    1 +
 .../mx31/serial.c => drivers/serial/serial_mx31.c  |    6 ------
 3 files changed, 2 insertions(+), 7 deletions(-)
 rename cpu/arm1136/mx31/serial.c => drivers/serial/serial_mx31.c (99%)
cpu/arm1136/mx31/Makefile +1 -1
index b648ffd..0e06f0a 100644
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= interrupts.o serial.o generic.o
+COBJS	= interrupts.o generic.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
drivers/serial/Makefile +1 -0
index e76a2ad..619d9da 100644
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
+COBJS-$(CONFIG_MX31_UART) += serial_mx31.o
 COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
drivers/serial/serial_mx31.c renamed from cpu/arm1136/mx31/serial.c +0 -6
similarity index 99%
rename from cpu/arm1136/mx31/serial.c
rename to drivers/serial/serial_mx31.c
index e025e94..7c0682a 100644
@@ -18,9 +18,6 @@
  */
 
 #include <common.h>
-
-#if defined CONFIG_MX31_UART
-
 #include <asm/arch/mx31.h>
 
 #define __REG(x)     (*((volatile u32 *)(x)))
@@ -227,6 +224,3 @@ int serial_init (void)
 
 	return 0;
 }
-
-
-#endif /* CONFIG_MX31 */
Signature · 1 line
1.6.2.1
#8 lore raw

PATCH 9/19 s3c64xx: move usb driver to drivers/usb

add CONFIG_USB_S3C64XX to activate the driver

---
 cpu/arm1176/s3c64xx/Makefile                       |    1 -
 drivers/usb/Makefile                               |    1 +
 .../s3c64xx/usb.c => drivers/usb/s3c64xx_usb.c     |    0
 include/configs/smdk6400.h                         |    1 +
 4 files changed, 2 insertions(+), 1 deletions(-)
 rename cpu/arm1176/s3c64xx/usb.c => drivers/usb/s3c64xx_usb.c (100%)
cpu/arm1176/s3c64xx/Makefile +0 -1
index 4ab1811..fa4ee3f 100644
@@ -30,7 +30,6 @@ LIB	= $(obj)lib$(SOC).a
 
 COBJS-y	= interrupts.o
 COBJS-$(CONFIG_S3C6400)	+= cpu_init.o speed.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb.o
 
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
 
drivers/usb/Makefile +1 -0
index b306a65..7ddb72a 100644
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
 # host
 COBJS-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
 COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
+COBJS-$(CONFIG_USB_S3C64XX) += s3c64xx_usb.o
 COBJS-$(CONFIG_USB_SL811HS) += sl811_usb.o
 COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o
 COBJS-$(CONFIG_USB_EHCI_PCI) += usb_ehci_pci.o
drivers/usb/s3c64xx_usb.c renamed from cpu/arm1176/s3c64xx/usb.c +0 -0
similarity index 100%
rename from cpu/arm1176/s3c64xx/usb.c
rename to drivers/usb/s3c64xx_usb.c
include/configs/smdk6400.h +1 -0
index 06d6a88..d3cf6e5 100644
@@ -288,6 +288,7 @@
 
 #if !defined(CONFIG_ENABLE_MMU)
 #define CONFIG_CMD_USB			1
+#define CONFIG_USB_S3C64XX
 #define CONFIG_USB_OHCI_NEW		1
 #define CONFIG_SYS_USB_OHCI_REGS_BASE		0x74300000
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME		"s3c6400"
Signature · 1 line
1.6.2.1
#9 lore raw

PATCH 10/19 ks8695: move serial driver to drivers/serial

add CONFIG_KS8695_SERIAL to activate the driver

---
 cpu/arm920t/ks8695/Makefile                        |    2 +-
 drivers/serial/Makefile                            |    1 +
 .../serial.c => drivers/serial/serial_ks8695.c     |    0
 include/configs/cm4008.h                           |    1 +
 include/configs/cm41xx.h                           |    1 +
 5 files changed, 4 insertions(+), 1 deletions(-)
 rename cpu/arm920t/ks8695/serial.c => drivers/serial/serial_ks8695.c (100%)
cpu/arm920t/ks8695/Makefile +1 -1
index 7db9473..f6b0063 100644
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= interrupts.o serial.o
+COBJS	= interrupts.o
 SOBJS	= lowlevel_init.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
drivers/serial/Makefile +1 -0
index 619d9da..95255df 100644
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
+COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-$(CONFIG_MX31_UART) += serial_mx31.o
 COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
drivers/serial/serial_ks8695.c renamed from cpu/arm920t/ks8695/serial.c +0 -0
similarity index 100%
rename from cpu/arm920t/ks8695/serial.c
rename to drivers/serial/serial_ks8695.c
include/configs/cm4008.h +1 -0
index 124fad7..7ea1a46 100644
@@ -53,6 +53,7 @@
  * select serial console configuration
  */
 #define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_KS8695_SERIAL
 #define	CONFIG_SERIAL1
 #define CONFIG_CONS_INDEX	1
 #define CONFIG_BAUDRATE		115200
include/configs/cm41xx.h +1 -0
index 5c255ce..ea374da 100644
@@ -53,6 +53,7 @@
  * select serial console configuration
  */
 #define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_KS8695_SERIAL
 #define	CONFIG_SERIAL1
 #define CONFIG_CONS_INDEX	1
 #define CONFIG_BAUDRATE		115200
Signature · 1 line
1.6.2.1
#10 lore raw

PATCH 11/19 lpc2292: move serial driver to drivers/serial

add CONFIG_LPC2292_SERIAL to activate the driver

---
 cpu/arm720t/serial.c            |   77 ----------------------------
 drivers/serial/Makefile         |    1 +
 drivers/serial/serial_lpc2292.c |  105 +++++++++++++++++++++++++++++++++++++++
 include/configs/SMN42.h         |    1 +
 include/configs/lpc2292sodimm.h |    1 +
 5 files changed, 108 insertions(+), 77 deletions(-)
 create mode 100644 drivers/serial/serial_lpc2292.c
cpu/arm720t/serial.c +0 -77
index 54a9b31..b54d1cf 100644
@@ -122,81 +122,4 @@ serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-
-#elif defined(CONFIG_LPC2292)
-
-DECLARE_GLOBAL_DATA_PTR;
-
-#include <asm/arch/hardware.h>
-
-void serial_setbrg (void)
-{
-	unsigned short divisor = 0;
-
-	switch (gd->baudrate) {
-	case   1200:	divisor = 3072;	break;
-	case   9600:	divisor =  384;	break;
-	case  19200:	divisor =  192;	break;
-	case  38400:	divisor =   96;	break;
-	case  57600:	divisor =   64;	break;
-	case 115200:	divisor =   32;	break;
-	default:	hang ();	break;
-	}
-
-	/* init serial UART0 */
-	PUT8(U0LCR, 0);
-	PUT8(U0IER, 0);
-	PUT8(U0LCR, 0x80);	/* DLAB=1 */
-	PUT8(U0DLL, (unsigned char)(divisor & 0x00FF));
-	PUT8(U0DLM, (unsigned char)(divisor >> 8));
-	PUT8(U0LCR, 0x03);	/* 8N1, DLAB=0  */
-	PUT8(U0FCR, 1);		/* Enable RX and TX FIFOs */
-}
-
-int serial_init (void)
-{
-	unsigned long pinsel0;
-
-	serial_setbrg ();
-
-	pinsel0 = GET32(PINSEL0);
-	pinsel0 &= ~(0x00000003);
-	pinsel0 |= 5;
-	PUT32(PINSEL0, pinsel0);
-
-	return (0);
-}
-
-void serial_putc (const char c)
-{
-	if (c == '\n')
-	{
-		while((GET8(U0LSR) & (1<<5)) == 0); /* Wait for empty U0THR */
-		PUT8(U0THR, '\r');
-	}
-
-	while((GET8(U0LSR) & (1<<5)) == 0); /* Wait for empty U0THR */
-	PUT8(U0THR, c);
-}
-
-int serial_getc (void)
-{
-	while((GET8(U0LSR) & 1) == 0);
-	return GET8(U0RBR);
-}
-
-void
-serial_puts (const char *s)
-{
-	while (*s) {
-		serial_putc (*s++);
-	}
-}
-
-/* Test if there is a byte to read */
-int serial_tstc (void)
-{
-	return (GET8(U0LSR) & 1);
-}
-
 #endif
drivers/serial/Makefile +1 -0
index 95255df..eaf4f8e 100644
@@ -35,6 +35,7 @@ COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
+COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o
 COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o
 COBJS-$(CONFIG_MX31_UART) += serial_mx31.o
 COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
drivers/serial/serial_lpc2292.c new file +105 -0

105 lines not on this page · raw message

include/configs/SMN42.h +1 -0
index d6f41f9..05f6d9f 100644
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_LPC2292_SERIAL
 #define CONFIG_SERIAL1		1	/* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
include/configs/lpc2292sodimm.h +1 -0
index fa2917e..1515038 100644
@@ -59,6 +59,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_LPC2292_SERIAL
 #define CONFIG_SERIAL1		1	/* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
Signature · 1 line
1.6.2.1
#11 lore raw

PATCH 12/19 arm720t/clps7111: move serial driver to drivers/serial

add CONFIG_CLPS7111_SERIAL to activate the driver

---
 cpu/arm720t/Makefile                               |    2 +-
 drivers/serial/Makefile                            |    1 +
 .../serial.c => drivers/serial/serial_clps7111.c   |    4 ----
 include/configs/armadillo.h                        |    1 +
 include/configs/ep7312.h                           |    1 +
 include/configs/impa7.h                            |    1 +
 6 files changed, 5 insertions(+), 5 deletions(-)
 rename cpu/arm720t/serial.c => drivers/serial/serial_clps7111.c (96%)
cpu/arm720t/Makefile +1 -1
index a038042..d5ac7d3 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
-COBJS	= serial.o interrupts.o cpu.o
+COBJS	= interrupts.o cpu.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
drivers/serial/Makefile +1 -0
index eaf4f8e..6ab847f 100644
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_SYS_NS16550) += ns16550.o
 COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
+COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
 COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o
drivers/serial/serial_clps7111.c renamed from cpu/arm720t/serial.c +0 -4
similarity index 96%
rename from cpu/arm720t/serial.c
rename to drivers/serial/serial_clps7111.c
index b54d1cf..a6aecad 100644
@@ -29,9 +29,6 @@
  */
 
 #include <common.h>
-
-#if defined(CONFIG_IMPA7) || defined(CONFIG_EP7312) || defined(CONFIG_ARMADILLO)
-
 #include <clps7111.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -122,4 +119,3 @@ serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-#endif
include/configs/armadillo.h +1 -0
index ef6ce22..7ba5e17 100644
@@ -64,6 +64,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_CLPS7111_SERIAL
 #define CONFIG_SERIAL1		1	/* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
include/configs/ep7312.h +1 -0
index d12b13f..630fff3 100644
@@ -55,6 +55,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_CLPS7111_SERIAL
 #define CONFIG_SERIAL1		1	/* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
include/configs/impa7.h +1 -0
index efd4214..c7001cc 100644
@@ -54,6 +54,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_CLPS7111_SERIAL
 #define CONFIG_SERIAL1		1	/* we use Serial line 1 */
 
 /* allow to overwrite serial and ethaddr */
Signature · 1 line
1.6.2.1
#12 lore raw

PATCH 13/19 omap3: remove duplicate interrupts code

---
 cpu/arm_cortexa8/omap3/interrupts.c |  128 -----------------------------------
 1 files changed, 0 insertions(+), 128 deletions(-)
cpu/arm_cortexa8/omap3/interrupts.c +0 -128
index 9e9817d..384ffdc 100644
@@ -34,137 +34,9 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/proc-armv/ptrace.h>
 
 #define TIMER_LOAD_VAL 0
 
-#ifdef CONFIG_USE_IRQ
-/* enable IRQ interrupts */
-void enable_interrupts(void)
-{
-	unsigned long temp;
-	__asm__ __volatile__("mrs %0, cpsr\n"
-			     "bic %0, %0, #0x80\n" "msr cpsr_c, %0":"=r"(temp)
-			     ::"memory");
-}
-
-/*
- * disable IRQ/FIQ interrupts
- * returns true if interrupts had been enabled before we disabled them
- */
-int disable_interrupts(void)
-{
-	unsigned long old, temp;
-	__asm__ __volatile__("mrs %0, cpsr\n"
-			     "orr %1, %0, #0xc0\n"
-			     "msr cpsr_c, %1":"=r"(old), "=r"(temp)
-			     ::"memory");
-	return (old & 0x80) == 0;
-}
-#else
-void enable_interrupts(void)
-{
-	return;
-}
-int disable_interrupts(void)
-{
-	return 0;
-}
-#endif
-
-void bad_mode(void)
-{
-	panic("Resetting CPU ...\n");
-	reset_cpu(0);
-}
-
-void show_regs(struct pt_regs *regs)
-{
-	unsigned long flags;
-	const char *processor_modes[] = {
-		"USER_26", "FIQ_26", "IRQ_26", "SVC_26",
-		"UK4_26", "UK5_26", "UK6_26", "UK7_26",
-		"UK8_26", "UK9_26", "UK10_26", "UK11_26",
-		"UK12_26", "UK13_26", "UK14_26", "UK15_26",
-		"USER_32", "FIQ_32", "IRQ_32", "SVC_32",
-		"UK4_32", "UK5_32", "UK6_32", "ABT_32",
-		"UK8_32", "UK9_32", "UK10_32", "UND_32",
-		"UK12_32", "UK13_32", "UK14_32", "SYS_32",
-	};
-
-	flags = condition_codes(regs);
-
-	printf("pc : [<%08lx>]    lr : [<%08lx>]\n"
-		"sp : %08lx  ip : %08lx  fp : %08lx\n",
-		instruction_pointer(regs),
-		regs->ARM_lr, regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
-	printf("r10: %08lx  r9 : %08lx  r8 : %08lx\n",
-		regs->ARM_r10, regs->ARM_r9, regs->ARM_r8);
-	printf("r7 : %08lx  r6 : %08lx  r5 : %08lx  r4 : %08lx\n",
-		regs->ARM_r7, regs->ARM_r6, regs->ARM_r5, regs->ARM_r4);
-	printf("r3 : %08lx  r2 : %08lx  r1 : %08lx  r0 : %08lx\n",
-		regs->ARM_r3, regs->ARM_r2, regs->ARM_r1, regs->ARM_r0);
-	printf("Flags: %c%c%c%c",
-		flags & CC_N_BIT ? 'N' : 'n',
-		flags & CC_Z_BIT ? 'Z' : 'z',
-		flags & CC_C_BIT ? 'C' : 'c', flags & CC_V_BIT ? 'V' : 'v');
-	printf("  IRQs %s  FIQs %s  Mode %s%s\n",
-		interrupts_enabled(regs) ? "on" : "off",
-		fast_interrupts_enabled(regs) ? "on" : "off",
-		processor_modes[processor_mode(regs)],
-		thumb_mode(regs) ? " (T)" : "");
-}
-
-void do_undefined_instruction(struct pt_regs *pt_regs)
-{
-	printf("undefined instruction\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_software_interrupt(struct pt_regs *pt_regs)
-{
-	printf("software interrupt\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_prefetch_abort(struct pt_regs *pt_regs)
-{
-	printf("prefetch abort\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_data_abort(struct pt_regs *pt_regs)
-{
-	printf("data abort\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_not_used(struct pt_regs *pt_regs)
-{
-	printf("not used\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_fiq(struct pt_regs *pt_regs)
-{
-	printf("fast interrupt request\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_irq(struct pt_regs *pt_regs)
-{
-	printf("interrupt request\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-
 static ulong timestamp;
 static ulong lastinc;
 static gptimer_t *timer_base = (gptimer_t *)CONFIG_SYS_TIMERBASE;
Signature · 1 line
1.6.2.1
#13 lore raw

PATCH 14/19 imx: move serial driver to drivers/serial

---
 cpu/arm920t/imx/Makefile                           |    2 +-
 drivers/serial/Makefile                            |    1 +
 .../imx/serial.c => drivers/serial/serial_imx.c    |    6 ------
 include/configs/mx1ads.h                           |    1 +
 include/configs/mx1fs2.h                           |    3 ++-
 include/configs/scb9328.h                          |    1 +
 6 files changed, 6 insertions(+), 8 deletions(-)
 rename cpu/arm920t/imx/serial.c => drivers/serial/serial_imx.c (97%)
cpu/arm920t/imx/Makefile +1 -1
index 9207ec1..d3352de 100644
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= generic.o interrupts.o serial.o speed.o
+COBJS	= generic.o interrupts.o speed.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
drivers/serial/Makefile +1 -0
index 6ab847f..705ae47 100644
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_DRIVER_S3C4510_UART) += s3c4510b_uart.o
 COBJS-$(CONFIG_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_SYS_NS16550_SERIAL) += serial.o
 COBJS-$(CONFIG_CLPS7111_SERIAL) += serial_clps7111.o
+COBJS-$(CONFIG_IMX_SERIAL) += serial_imx.o
 COBJS-$(CONFIG_IXP_SERIAL) += serial_ixp.o
 COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
 COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o
drivers/serial/serial_imx.c renamed from cpu/arm920t/imx/serial.c +0 -6
similarity index 97%
rename from cpu/arm920t/imx/serial.c
rename to drivers/serial/serial_imx.c
index 85f1167..b9ca748 100644
@@ -18,12 +18,8 @@
  */
 
 #include <common.h>
-#if defined (CONFIG_IMX)
-
 #include <asm/arch/imx-regs.h>
 
-#ifndef CONFIG_IMX_SERIAL_NONE
-
 #if defined CONFIG_IMX_SERIAL1
 #define UART_BASE IMX_UART1_BASE
 #elif defined CONFIG_IMX_SERIAL2
@@ -223,5 +219,3 @@ serial_puts (const char *s)
 		serial_putc (*s++);
 	}
 }
-#endif /* CONFIG_IMX_SERIAL_NONE */
-#endif /* defined CONFIG_IMX */
include/configs/mx1ads.h +1 -0
index c3812e6..12e567b 100644
@@ -40,6 +40,7 @@
 /*
  * Select serial console configuration
   */
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL1		/* internal uart 1 */
 /* #define _CONFIG_UART2 */		/* internal uart 2 */
 /* #define CONFIG_SILENT_CONSOLE */	/* use this to disable output */
include/configs/mx1fs2.h +2 -1
index b174b5f..431e669 100644
@@ -289,11 +289,12 @@
    0x000b00b ->3<- -> 64MHz/4=16MHz */
 
 #ifdef _CONFIG_UART1
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL1
 #elif defined _CONFIG_UART2
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL2
 #elif defined _CONFIG_UART3 | defined _CONFIG_UART4
-#define CONFIG_IMX_SERIAL_NONE
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_CLK		3686400
include/configs/scb9328.h +1 -0
index 10db535..2f166c9 100644
@@ -29,6 +29,7 @@
 #define CONFIG_SCB9328		1     /* on a scb9328tronix board */
 #undef	CONFIG_USE_IRQ		      /* don't need use IRQ/FIQ	   */
 
+#define CONFIG_IMX_SERIAL
 #define CONFIG_IMX_SERIAL1
 /*
  * Select serial console configuration
Signature · 1 line
1.6.2.1
#14 lore raw

PATCH 15/19 davinci: move nand driver to drivers/mtd/nand

---
 cpu/arm926ejs/davinci/Makefile                     |    2 +-
 drivers/mtd/nand/Makefile                          |    1 +
 .../nand.c => drivers/mtd/nand/davinci_nand.c      |    9 ---------
 include/configs/davinci_dvevm.h                    |    1 +
 include/configs/davinci_schmoogie.h                |    1 +
 include/configs/davinci_sffsdr.h                   |    1 +
 include/configs/davinci_sonata.h                   |    1 +
 7 files changed, 6 insertions(+), 10 deletions(-)
 rename cpu/arm926ejs/davinci/nand.c => drivers/mtd/nand/davinci_nand.c (98%)
cpu/arm926ejs/davinci/Makefile +1 -1
index 0f77f40..53f7742 100644
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= timer.o ether.o lxt972.o dp83848.o i2c.o nand.o
+COBJS	= timer.o ether.o lxt972.o dp83848.o i2c.o
 SOBJS	= lowlevel_init.o reset.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
drivers/mtd/nand/Makefile +1 -0
index 03b0028..258ee25 100644
@@ -37,6 +37,7 @@ endif
 
 COBJS-$(CONFIG_NAND_ATMEL) += atmel_nand.o
 COBJS-$(CONFIG_DRIVER_NAND_BFIN) += bfin_nand.o
+COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
 COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
drivers/mtd/nand/davinci_nand.c renamed from cpu/arm926ejs/davinci/nand.c +0 -9
similarity index 98%
rename from cpu/arm926ejs/davinci/nand.c
rename to drivers/mtd/nand/davinci_nand.c
index 014e2b0..a974667 100644
@@ -43,10 +43,6 @@
 
 #include <common.h>
 #include <asm/io.h>
-
-#ifdef CONFIG_SYS_USE_NAND
-#if !defined(CONFIG_NAND_LEGACY)
-
 #include <nand.h>
 #include <asm/arch/nand_defs.h>
 #include <asm/arch/emif_defs.h>
@@ -468,8 +464,3 @@ int board_nand_init(struct nand_chip *nand)
 
 	return(0);
 }
-
-#else
-#error "U-Boot legacy NAND support not available for DaVinci chips"
-#endif
-#endif	/* CONFIG_SYS_USE_NAND */
include/configs/davinci_dvevm.h +1 -0
index 667c0d8..b43beaa 100644
@@ -112,6 +112,7 @@
 /* Flash & Environment */
 /*=====================*/
 #ifdef CONFIG_SYS_USE_NAND
+#define CONFIG_NAND_DAVINCI
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_IN_NAND		/* U-Boot env in NAND Flash  */
include/configs/davinci_schmoogie.h +1 -0
index 22d3808..2c97a00 100644
@@ -81,6 +81,7 @@
 /*=====================*/
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
+#define CONFIG_NAND_DAVINCI
 #define CONFIG_ENV_IS_IN_NAND		/* U-Boot env in NAND Flash  */
 #define CONFIG_ENV_SECT_SIZE	2048	/* Env sector Size */
 #define CONFIG_ENV_SIZE		SZ_128K
include/configs/davinci_sffsdr.h +1 -0
index 875bab6..9354c2f 100644
@@ -77,6 +77,7 @@
 /* Flash & Environment */
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
+#define CONFIG_NAND_DAVINCI
 #define CONFIG_ENV_IS_IN_NAND		/* U-Boot env in NAND Flash  */
 #define CONFIG_ENV_SECT_SIZE	2048	/* Env sector Size */
 #define CONFIG_ENV_SIZE		SZ_128K
include/configs/davinci_sonata.h +1 -0
index 47ab27a..0865d0d 100644
@@ -112,6 +112,7 @@
 /* Flash & Environment */
 /*=====================*/
 #ifdef CONFIG_SYS_USE_NAND
+#define CONFIG_NAND_DAVINCI
 #undef CONFIG_ENV_IS_IN_FLASH
 #define CONFIG_SYS_NO_FLASH
 #define CONFIG_ENV_IS_IN_NAND		/* U-Boot env in NAND Flash  */
Signature · 1 line
1.6.2.1
#15 lore raw

PATCH 16/19 davinci: move i2c driver to drivers/i2c

---
 cpu/arm926ejs/davinci/Makefile                     |    2 +-
 drivers/i2c/Makefile                               |    1 +
 .../davinci/i2c.c => drivers/i2c/davinci_i2c.c     |    5 -----
 3 files changed, 2 insertions(+), 6 deletions(-)
 rename cpu/arm926ejs/davinci/i2c.c => drivers/i2c/davinci_i2c.c (98%)
cpu/arm926ejs/davinci/Makefile +1 -1
index 53f7742..ed24e65 100644
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= timer.o ether.o lxt972.o dp83848.o i2c.o
+COBJS	= timer.o ether.o lxt972.o dp83848.o
 SOBJS	= lowlevel_init.o reset.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
drivers/i2c/Makefile +1 -0
index 69cf9a6..4b4d9db 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	:= $(obj)libi2c.a
 
 COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
+COBJS-$(CONFIG_DRIVER_DAVINCI_I2C) += davinci_i2c.o
 COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
drivers/i2c/davinci_i2c.c renamed from cpu/arm926ejs/davinci/i2c.c +0 -5
similarity index 98%
rename from cpu/arm926ejs/davinci/i2c.c
rename to drivers/i2c/davinci_i2c.c
index 3ba20ef..eee1cbd 100644
@@ -25,9 +25,6 @@
  */
 
 #include <common.h>
-
-#ifdef CONFIG_DRIVER_DAVINCI_I2C
-
 #include <i2c.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/i2c_defs.h>
@@ -330,5 +327,3 @@ int i2c_write(u_int8_t chip, u_int32_t addr, int alen, u_int8_t *buf, int len)
 
 	return(0);
 }
-
-#endif /* CONFIG_DRIVER_DAVINCI_I2C */
Signature · 1 line
1.6.2.1
#16 lore raw

PATCH 17/19 s3c24x0: move serial driver to drivers/serial

---
 cpu/arm920t/s3c24x0/Makefile                       |    3 +--
 drivers/serial/Makefile                            |    1 +
 .../serial.c => drivers/serial/serial_s3c24x0.c    |    4 ----
 include/configs/VCMA9.h                            |    1 +
 include/configs/sbc2410x.h                         |    1 +
 include/configs/smdk2400.h                         |    1 +
 include/configs/smdk2410.h                         |    1 +
 include/configs/trab.h                             |    1 +
 8 files changed, 7 insertions(+), 6 deletions(-)
 rename cpu/arm920t/s3c24x0/serial.c => drivers/serial/serial_s3c24x0.c (97%)
cpu/arm920t/s3c24x0/Makefile +1 -2
index 6764920..8fd525e 100644
@@ -25,8 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= i2c.o interrupts.o serial.o speed.o \
-	  usb.o usb_ohci.o nand.o
+COBJS	= i2c.o interrupts.o speed.o usb.o usb_ohci.o nand.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
drivers/serial/Makefile +1 -0
index 705ae47..696d5fb 100644
@@ -44,6 +44,7 @@ COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o
 COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
 COBJS-$(CONFIG_SA1100_SERIAL) += serial_sa1100.o
+COBJS-$(CONFIG_S3C24X0_SERIAL) += serial_s3c24x0.o
 COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
drivers/serial/serial_s3c24x0.c renamed from cpu/arm920t/s3c24x0/serial.c +0 -4
similarity index 97%
rename from cpu/arm920t/s3c24x0/serial.c
rename to drivers/serial/serial_s3c24x0.c
index 064b998..1b1b7a6 100644
@@ -19,8 +19,6 @@
  */
 
 #include <common.h>
-#if defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB)
-
 #if defined(CONFIG_S3C2400) || defined(CONFIG_TRAB)
 #include <s3c2400.h>
 #elif defined(CONFIG_S3C2410)
@@ -300,5 +298,3 @@ struct serial_device s3c24xx_serial2_device =
 	INIT_S3C_SERIAL_STRUCTURE(2, "s3ser2", "S3UART3");
 
 #endif /* CONFIG_SERIAL_MULTI */
-
-#endif /* defined(CONFIG_S3C2400) || defined (CONFIG_S3C2410) || defined (CONFIG_TRAB) */
include/configs/VCMA9.h +1 -0
index 8550223..5e614fd 100644
@@ -117,6 +117,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1          1	/* we use SERIAL 1 on VCMA9 */
 
 /************************************************************
include/configs/sbc2410x.h +1 -0
index 102c45a..2b659e3 100644
@@ -70,6 +70,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1          1	/* we use SERIAL 1 on SBC2410X */
 
 /************************************************************
include/configs/smdk2400.h +1 -0
index 856d1fb..ffdf217 100644
@@ -63,6 +63,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1          1	/* we use SERIAL 1 on SAMSUNG */
 
 #undef	CONFIG_HWFLOW			/* include RTS/CTS flow control support	*/
include/configs/smdk2410.h +1 -0
index 797a596..fb43706 100644
@@ -60,6 +60,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1          1	/* we use SERIAL 1 on SMDK2410 */
 
 /************************************************************
include/configs/trab.h +1 -0
index 625d8ee..520fe36 100644
@@ -111,6 +111,7 @@
 /*
  * select serial console configuration
  */
+#define CONFIG_S3C24X0_SERIAL
 #define CONFIG_SERIAL1		1	/* we use SERIAL 1 on TRAB */
 
 #define CONFIG_HWFLOW			/* include RTS/CTS flow control support	*/
Signature · 1 line
1.6.2.1
#17 lore raw

PATCH 18/19 s3c24x0: move i2c driver to drivers/i2c

---
 cpu/arm920t/s3c24x0/Makefile                       |    2 +-
 drivers/i2c/Makefile                               |    1 +
 .../s3c24x0/i2c.c => drivers/i2c/s3c24x0_i2c.c     |    5 -----
 3 files changed, 2 insertions(+), 6 deletions(-)
 rename cpu/arm920t/s3c24x0/i2c.c => drivers/i2c/s3c24x0_i2c.c (99%)
cpu/arm920t/s3c24x0/Makefile +1 -1
index 8fd525e..fd13e53 100644
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= i2c.o interrupts.o speed.o usb.o usb_ohci.o nand.o
+COBJS	= interrupts.o speed.o usb.o usb_ohci.o nand.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
drivers/i2c/Makefile +1 -0
index 4b4d9db..ef32f13 100644
@@ -32,6 +32,7 @@ COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP34XX_I2C) += omap24xx_i2c.o
+COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o
 COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o
 COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
drivers/i2c/s3c24x0_i2c.c renamed from cpu/arm920t/s3c24x0/i2c.c +0 -5
similarity index 99%
rename from cpu/arm920t/s3c24x0/i2c.c
rename to drivers/i2c/s3c24x0_i2c.c
index fba5cd1..f0c1aa3 100644
@@ -27,9 +27,6 @@
  */
 
 #include <common.h>
-
-#ifdef CONFIG_DRIVER_S3C24X0_I2C
-
 #if defined(CONFIG_S3C2400)
 #include <s3c2400.h>
 #elif defined(CONFIG_S3C2410)
@@ -443,5 +440,3 @@ int i2c_write (uchar chip, uint addr, int alen, uchar * buffer, int len)
 		 len) != 0);
 }
 #endif	/* CONFIG_HARD_I2C */
-
-#endif /* CONFIG_DRIVER_S3C24X0_I2C */
Signature · 1 line
1.6.2.1
#18 lore raw

PATCH 19/19 s3c2410: move nand driver to drivers/mtd/nand

---
 cpu/arm920t/s3c24x0/Makefile                       |    2 +-
 drivers/mtd/nand/Makefile                          |    1 +
 .../nand.c => drivers/mtd/nand/s3c2410_nand.c      |    8 --------
 include/configs/sbc2410x.h                         |    1 +
 4 files changed, 3 insertions(+), 9 deletions(-)
 rename cpu/arm920t/s3c24x0/nand.c => drivers/mtd/nand/s3c2410_nand.c (96%)
cpu/arm920t/s3c24x0/Makefile +1 -1
index fd13e53..3afe19c 100644
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).a
 
-COBJS	= interrupts.o speed.o usb.o usb_ohci.o nand.o
+COBJS	= interrupts.o speed.o usb.o usb_ohci.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
drivers/mtd/nand/Makefile +1 -0
index 258ee25..471cd6b 100644
@@ -41,6 +41,7 @@ COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
 COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o
+COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.c
 COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 endif
drivers/mtd/nand/s3c2410_nand.c renamed from cpu/arm920t/s3c24x0/nand.c +0 -8
similarity index 96%
rename from cpu/arm920t/s3c24x0/nand.c
rename to drivers/mtd/nand/s3c2410_nand.c
index 60174fb..d27a625 100644
@@ -26,9 +26,6 @@
 #define DEBUGN(x, args ...) {}
 #endif
 
-#if defined(CONFIG_CMD_NAND)
-#if !defined(CONFIG_NAND_LEGACY)
-
 #include <nand.h>
 #include <s3c2410.h>
 #include <asm/io.h>
@@ -172,8 +169,3 @@ int board_nand_init(struct nand_chip *nand)
 
 	return 0;
 }
-
-#else
- #error "U-Boot legacy NAND support not available for S3C2410"
-#endif
-#endif
include/configs/sbc2410x.h +1 -0
index 2b659e3..af00187 100644
@@ -199,6 +199,7 @@
  * NAND flash settings
  */
 #if defined(CONFIG_CMD_NAND)
+#define CONFIG_NAND_S3C2410
 #define CONFIG_SYS_MAX_NAND_DEVICE	1	/* Max number of NAND devices		*/
 #define SECTORSIZE 512
 
Signature · 1 line
1.6.2.1
#19 lore raw

PATCH 13/19 omap3: remove duplicate interrupts code

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe,

Quoted 4 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 cpu/arm_cortexa8/omap3/interrupts.c |  128 -----------------------------------
 1 files changed, 0 insertions(+), 128 deletions(-)

It seems to me that this patch is a re-post of

http://lists.denx.de/pipermail/u-boot/2009-March/049736.html

?

If this is the case, it would be helpful if you could mark re-send patches with 'v2' or something similar, explain what changed (or what's unchanged) and that the previous patch is obsolete with the re-post.

Dirk

Btw.: A description in the body of a patch (and not subject only) going into git would be nice, too. E.g.

"Remove interrupt code which is already in xxx and therefore not needed here"

Quoted 142 lines
cpu/arm_cortexa8/omap3/interrupts.c +0 -128
index 9e9817d..384ffdc 100644
@@ -34,137 +34,9 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/proc-armv/ptrace.h>
 
 #define TIMER_LOAD_VAL 0
 
-#ifdef CONFIG_USE_IRQ
-/* enable IRQ interrupts */
-void enable_interrupts(void)
-{
-	unsigned long temp;
-	__asm__ __volatile__("mrs %0, cpsr\n"
-			     "bic %0, %0, #0x80\n" "msr cpsr_c, %0":"=r"(temp)
-			     ::"memory");
-}
-
-/*
- * disable IRQ/FIQ interrupts
- * returns true if interrupts had been enabled before we disabled them
- */
-int disable_interrupts(void)
-{
-	unsigned long old, temp;
-	__asm__ __volatile__("mrs %0, cpsr\n"
-			     "orr %1, %0, #0xc0\n"
-			     "msr cpsr_c, %1":"=r"(old), "=r"(temp)
-			     ::"memory");
-	return (old & 0x80) == 0;
-}
-#else
-void enable_interrupts(void)
-{
-	return;
-}
-int disable_interrupts(void)
-{
-	return 0;
-}
-#endif
-
-void bad_mode(void)
-{
-	panic("Resetting CPU ...\n");
-	reset_cpu(0);
-}
-
-void show_regs(struct pt_regs *regs)
-{
-	unsigned long flags;
-	const char *processor_modes[] = {
-		"USER_26", "FIQ_26", "IRQ_26", "SVC_26",
-		"UK4_26", "UK5_26", "UK6_26", "UK7_26",
-		"UK8_26", "UK9_26", "UK10_26", "UK11_26",
-		"UK12_26", "UK13_26", "UK14_26", "UK15_26",
-		"USER_32", "FIQ_32", "IRQ_32", "SVC_32",
-		"UK4_32", "UK5_32", "UK6_32", "ABT_32",
-		"UK8_32", "UK9_32", "UK10_32", "UND_32",
-		"UK12_32", "UK13_32", "UK14_32", "SYS_32",
-	};
-
-	flags = condition_codes(regs);
-
-	printf("pc : [<%08lx>]    lr : [<%08lx>]\n"
-		"sp : %08lx  ip : %08lx  fp : %08lx\n",
-		instruction_pointer(regs),
-		regs->ARM_lr, regs->ARM_sp, regs->ARM_ip, regs->ARM_fp);
-	printf("r10: %08lx  r9 : %08lx  r8 : %08lx\n",
-		regs->ARM_r10, regs->ARM_r9, regs->ARM_r8);
-	printf("r7 : %08lx  r6 : %08lx  r5 : %08lx  r4 : %08lx\n",
-		regs->ARM_r7, regs->ARM_r6, regs->ARM_r5, regs->ARM_r4);
-	printf("r3 : %08lx  r2 : %08lx  r1 : %08lx  r0 : %08lx\n",
-		regs->ARM_r3, regs->ARM_r2, regs->ARM_r1, regs->ARM_r0);
-	printf("Flags: %c%c%c%c",
-		flags & CC_N_BIT ? 'N' : 'n',
-		flags & CC_Z_BIT ? 'Z' : 'z',
-		flags & CC_C_BIT ? 'C' : 'c', flags & CC_V_BIT ? 'V' : 'v');
-	printf("  IRQs %s  FIQs %s  Mode %s%s\n",
-		interrupts_enabled(regs) ? "on" : "off",
-		fast_interrupts_enabled(regs) ? "on" : "off",
-		processor_modes[processor_mode(regs)],
-		thumb_mode(regs) ? " (T)" : "");
-}
-
-void do_undefined_instruction(struct pt_regs *pt_regs)
-{
-	printf("undefined instruction\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_software_interrupt(struct pt_regs *pt_regs)
-{
-	printf("software interrupt\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_prefetch_abort(struct pt_regs *pt_regs)
-{
-	printf("prefetch abort\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_data_abort(struct pt_regs *pt_regs)
-{
-	printf("data abort\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_not_used(struct pt_regs *pt_regs)
-{
-	printf("not used\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_fiq(struct pt_regs *pt_regs)
-{
-	printf("fast interrupt request\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-void do_irq(struct pt_regs *pt_regs)
-{
-	printf("interrupt request\n");
-	show_regs(pt_regs);
-	bad_mode();
-}
-
-
 static ulong timestamp;
 static ulong lastinc;
 static gptimer_t *timer_base = (gptimer_t *)CONFIG_SYS_TIMERBASE;