Skip to contentSkip to conversation

at91sam9/at91cap: spi init add hardware chip select support

PATCH New Jean-Christophe PLAGNIOL-VILLARD 12 participants 62 messages Mar 27, 2009 – May 26, 2009

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

PATCH v2 1/13 at91sam9/at91cap: spi init add hardware chip select support

---
Fix typo in the commit message

Best Regards,
J.

 cpu/arm926ejs/at91/at91cap9_spi.c    |   37 ++++++++++++++++++++++++++++-----
 cpu/arm926ejs/at91/at91sam9260_spi.c |   36 +++++++++++++++++++++++++++-----
 cpu/arm926ejs/at91/at91sam9261_spi.c |   36 +++++++++++++++++++++++++++-----
 cpu/arm926ejs/at91/at91sam9263_spi.c |   36 +++++++++++++++++++++++++++-----
 cpu/arm926ejs/at91/at91sam9rl_spi.c  |   18 +++++++++++++--
 5 files changed, 136 insertions(+), 27 deletions(-)
cpu/arm926ejs/at91/at91cap9_spi.c +31 -6
index 356a804..cd8143b 100644
@@ -38,15 +38,27 @@ void at91_spi0_hw_init(unsigned long cs_mask)
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_SPI0);
 
 	if (cs_mask & (1 << 0)) {
-		at91_set_gpio_output(AT91_PIN_PA5, 1);
+		at91_set_B_periph(AT91_PIN_PA5, 1);
 	}
 	if (cs_mask & (1 << 1)) {
-		at91_set_gpio_output(AT91_PIN_PA3, 1);
+		at91_set_B_periph(AT91_PIN_PA3, 1);
 	}
 	if (cs_mask & (1 << 2)) {
-		at91_set_gpio_output(AT91_PIN_PD0, 1);
+		at91_set_B_periph(AT91_PIN_PD0, 1);
 	}
 	if (cs_mask & (1 << 3)) {
+		at91_set_B_periph(AT91_PIN_PD1, 1);
+	}
+	if (cs_mask & (1 << 4)) {
+		at91_set_gpio_output(AT91_PIN_PA5, 1);
+	}
+	if (cs_mask & (1 << 5)) {
+		at91_set_gpio_output(AT91_PIN_PA3, 1);
+	}
+	if (cs_mask & (1 << 6)) {
+		at91_set_gpio_output(AT91_PIN_PD0, 1);
+	}
+	if (cs_mask & (1 << 7)) {
 		at91_set_gpio_output(AT91_PIN_PD1, 1);
 	}
 }
@@ -61,15 +73,28 @@ void at91_spi1_hw_init(unsigned long cs_mask)
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_SPI1);
 
 	if (cs_mask & (1 << 0)) {
-		at91_set_gpio_output(AT91_PIN_PB15, 1);
+		at91_set_A_periph(AT91_PIN_PB15, 1);
 	}
 	if (cs_mask & (1 << 1)) {
-		at91_set_gpio_output(AT91_PIN_PB16, 1);
+		at91_set_A_periph(AT91_PIN_PB16, 1);
 	}
 	if (cs_mask & (1 << 2)) {
-		at91_set_gpio_output(AT91_PIN_PB17, 1);
+		at91_set_A_periph(AT91_PIN_PB17, 1);
 	}
 	if (cs_mask & (1 << 3)) {
+		at91_set_A_periph(AT91_PIN_PB18, 1);
+	}
+	if (cs_mask & (1 << 4)) {
+		at91_set_gpio_output(AT91_PIN_PB15, 1);
+	}
+	if (cs_mask & (1 << 5)) {
+		at91_set_gpio_output(AT91_PIN_PB16, 1);
+	}
+	if (cs_mask & (1 << 6)) {
+		at91_set_gpio_output(AT91_PIN_PB17, 1);
+	}
+	if (cs_mask & (1 << 7)) {
 		at91_set_gpio_output(AT91_PIN_PB18, 1);
 	}
+
 }
cpu/arm926ejs/at91/at91sam9260_spi.c +30 -6
index 0105072..d6fd80e 100644
@@ -38,15 +38,27 @@ void at91_spi0_hw_init(unsigned long cs_mask)
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_SPI0);
 
 	if (cs_mask & (1 << 0)) {
-		at91_set_gpio_output(AT91_PIN_PA3, 1);
+		at91_set_A_periph(AT91_PIN_PA3, 1);
 	}
 	if (cs_mask & (1 << 1)) {
-		at91_set_gpio_output(AT91_PIN_PC11, 1);
+		at91_set_B_periph(AT91_PIN_PC11, 1);
 	}
 	if (cs_mask & (1 << 2)) {
-		at91_set_gpio_output(AT91_PIN_PC16, 1);
+		at91_set_B_periph(AT91_PIN_PC16, 1);
 	}
 	if (cs_mask & (1 << 3)) {
+		at91_set_B_periph(AT91_PIN_PC17, 1);
+	}
+	if (cs_mask & (1 << 4)) {
+		at91_set_gpio_output(AT91_PIN_PA3, 1);
+	}
+	if (cs_mask & (1 << 5)) {
+		at91_set_gpio_output(AT91_PIN_PC11, 1);
+	}
+	if (cs_mask & (1 << 6)) {
+		at91_set_gpio_output(AT91_PIN_PC16, 1);
+	}
+	if (cs_mask & (1 << 7)) {
 		at91_set_gpio_output(AT91_PIN_PC17, 1);
 	}
 }
@@ -61,15 +73,27 @@ void at91_spi1_hw_init(unsigned long cs_mask)
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_SPI1);
 
 	if (cs_mask & (1 << 0)) {
-		at91_set_gpio_output(AT91_PIN_PB3, 1);
+		at91_set_A_periph(AT91_PIN_PB3, 1);
 	}
 	if (cs_mask & (1 << 1)) {
-		at91_set_gpio_output(AT91_PIN_PC5, 1);
+		at91_set_B_periph(AT91_PIN_PC5, 1);
 	}
 	if (cs_mask & (1 << 2)) {
-		at91_set_gpio_output(AT91_PIN_PC4, 1);
+		at91_set_B_periph(AT91_PIN_PC4, 1);
 	}
 	if (cs_mask & (1 << 3)) {
 		at91_set_gpio_output(AT91_PIN_PC3, 1);
 	}
+	if (cs_mask & (1 << 4)) {
+		at91_set_gpio_output(AT91_PIN_PB3, 1);
+	}
+	if (cs_mask & (1 << 5)) {
+		at91_set_gpio_output(AT91_PIN_PC5, 1);
+	}
+	if (cs_mask & (1 << 6)) {
+		at91_set_gpio_output(AT91_PIN_PC4, 1);
+	}
+	if (cs_mask & (1 << 7)) {
+		at91_set_gpio_output(AT91_PIN_PC3, 1);
+	}
 }
cpu/arm926ejs/at91/at91sam9261_spi.c +30 -6
index f70320d..9383dc6 100644
@@ -38,15 +38,27 @@ void at91_spi0_hw_init(unsigned long cs_mask)
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9261_ID_SPI0);
 
 	if (cs_mask & (1 << 0)) {
-		at91_set_gpio_output(AT91_PIN_PA3, 1);
+		at91_set_A_periph(AT91_PIN_PA3, 1);
 	}
 	if (cs_mask & (1 << 1)) {
-		at91_set_gpio_output(AT91_PIN_PA4, 1);
+		at91_set_A_periph(AT91_PIN_PA4, 1);
 	}
 	if (cs_mask & (1 << 2)) {
-		at91_set_gpio_output(AT91_PIN_PA5, 1);
+		at91_set_A_periph(AT91_PIN_PA5, 1);
 	}
 	if (cs_mask & (1 << 3)) {
+		at91_set_A_periph(AT91_PIN_PA6, 1);
+	}
+	if (cs_mask & (1 << 4)) {
+		at91_set_gpio_output(AT91_PIN_PA3, 1);
+	}
+	if (cs_mask & (1 << 5)) {
+		at91_set_gpio_output(AT91_PIN_PA4, 1);
+	}
+	if (cs_mask & (1 << 6)) {
+		at91_set_gpio_output(AT91_PIN_PA5, 1);
+	}
+	if (cs_mask & (1 << 7)) {
 		at91_set_gpio_output(AT91_PIN_PA6, 1);
 	}
 }
@@ -61,15 +73,27 @@ void at91_spi1_hw_init(unsigned long cs_mask)
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9261_ID_SPI1);
 
 	if (cs_mask & (1 << 0)) {
-		at91_set_gpio_output(AT91_PIN_PB28, 1);
+		at91_set_A_periph(AT91_PIN_PB28, 1);
 	}
 	if (cs_mask & (1 << 1)) {
-		at91_set_gpio_output(AT91_PIN_PA24, 1);
+		at91_set_B_periph(AT91_PIN_PA24, 1);
 	}
 	if (cs_mask & (1 << 2)) {
-		at91_set_gpio_output(AT91_PIN_PA25, 1);
+		at91_set_B_periph(AT91_PIN_PA25, 1);
 	}
 	if (cs_mask & (1 << 3)) {
+		at91_set_A_periph(AT91_PIN_PA26, 1);
+	}
+	if (cs_mask & (1 << 4)) {
+		at91_set_gpio_output(AT91_PIN_PB28, 1);
+	}
+	if (cs_mask & (1 << 5)) {
+		at91_set_gpio_output(AT91_PIN_PA24, 1);
+	}
+	if (cs_mask & (1 << 6)) {
+		at91_set_gpio_output(AT91_PIN_PA25, 1);
+	}
+	if (cs_mask & (1 << 7)) {
 		at91_set_gpio_output(AT91_PIN_PA26, 1);
 	}
 }
cpu/arm926ejs/at91/at91sam9263_spi.c +30 -6
index 1dda04c..e52dd61 100644
@@ -38,15 +38,27 @@ void at91_spi0_hw_init(unsigned long cs_mask)
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_SPI0);
 
 	if (cs_mask & (1 << 0)) {
-		at91_set_gpio_output(AT91_PIN_PA5, 1);
+		at91_set_B_periph(AT91_PIN_PA5, 1);
 	}
 	if (cs_mask & (1 << 1)) {
-		at91_set_gpio_output(AT91_PIN_PA3, 1);
+		at91_set_B_periph(AT91_PIN_PA3, 1);
 	}
 	if (cs_mask & (1 << 2)) {
-		at91_set_gpio_output(AT91_PIN_PA4, 1);
+		at91_set_B_periph(AT91_PIN_PA4, 1);
 	}
 	if (cs_mask & (1 << 3)) {
+		at91_set_B_periph(AT91_PIN_PB11, 1);
+	}
+	if (cs_mask & (1 << 4)) {
+		at91_set_gpio_output(AT91_PIN_PA5, 1);
+	}
+	if (cs_mask & (1 << 5)) {
+		at91_set_gpio_output(AT91_PIN_PA3, 1);
+	}
+	if (cs_mask & (1 << 6)) {
+		at91_set_gpio_output(AT91_PIN_PA4, 1);
+	}
+	if (cs_mask & (1 << 7)) {
 		at91_set_gpio_output(AT91_PIN_PB11, 1);
 	}
 }
@@ -61,15 +73,27 @@ void at91_spi1_hw_init(unsigned long cs_mask)
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_SPI1);
 
 	if (cs_mask & (1 << 0)) {
-		at91_set_gpio_output(AT91_PIN_PB15, 1);
+		at91_set_A_periph(AT91_PIN_PB15, 1);
 	}
 	if (cs_mask & (1 << 1)) {
-		at91_set_gpio_output(AT91_PIN_PB16, 1);
+		at91_set_A_periph(AT91_PIN_PB16, 1);
 	}
 	if (cs_mask & (1 << 2)) {
-		at91_set_gpio_output(AT91_PIN_PB17, 1);
+		at91_set_A_periph(AT91_PIN_PB17, 1);
 	}
 	if (cs_mask & (1 << 3)) {
+		at91_set_A_periph(AT91_PIN_PB18, 1);
+	}
+	if (cs_mask & (1 << 4)) {
+		at91_set_gpio_output(AT91_PIN_PB15, 1);
+	}
+	if (cs_mask & (1 << 5)) {
+		at91_set_gpio_output(AT91_PIN_PB16, 1);
+	}
+	if (cs_mask & (1 << 6)) {
+		at91_set_gpio_output(AT91_PIN_PB17, 1);
+	}
+	if (cs_mask & (1 << 7)) {
 		at91_set_gpio_output(AT91_PIN_PB18, 1);
 	}
 }
cpu/arm926ejs/at91/at91sam9rl_spi.c +15 -3
index aa9c183..389d6d8 100644
@@ -38,15 +38,27 @@ void at91_spi0_hw_init(unsigned long cs_mask)
 	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9RL_ID_SPI);
 
 	if (cs_mask & (1 << 0)) {
-		at91_set_gpio_output(AT91_PIN_PA28, 1);
+		at91_set_A_periph(AT91_PIN_PA28, 1);
 	}
 	if (cs_mask & (1 << 1)) {
-		at91_set_gpio_output(AT91_PIN_PB7, 1);
+		at91_set_B_periph(AT91_PIN_PB7, 1);
 	}
 	if (cs_mask & (1 << 2)) {
-		at91_set_gpio_output(AT91_PIN_PD8, 1);
+		at91_set_A_periph(AT91_PIN_PD8, 1);
 	}
 	if (cs_mask & (1 << 3)) {
+		at91_set_B_periph(AT91_PIN_PD9, 1);
+	}
+	if (cs_mask & (1 << 4)) {
+		at91_set_gpio_output(AT91_PIN_PA28, 1);
+	}
+	if (cs_mask & (1 << 5)) {
+		at91_set_gpio_output(AT91_PIN_PB7, 1);
+	}
+	if (cs_mask & (1 << 6)) {
+		at91_set_gpio_output(AT91_PIN_PD8, 1);
+	}
+	if (cs_mask & (1 << 7)) {
 		at91_set_gpio_output(AT91_PIN_PD9, 1);
 	}
 }
Signature · 1 line
1.6.2.1
#1 lore raw

PATCH v2 2/13 at91sam9: add watchdog support

---
update the readme

Best Regards,
J.

 Makefile                             |    1 +
 doc/README.at91                      |   11 +++++
 drivers/serial/atmel_usart.c         |    4 +-
 drivers/watchdog/Makefile            |   46 ++++++++++++++++++++
 drivers/watchdog/at91sam9_wdt.c      |   79 ++++++++++++++++++++++++++++++++++
 include/asm-arm/arch-at91/at91_wdt.h |   38 ++++++++++++++++
 6 files changed, 178 insertions(+), 1 deletions(-)
 create mode 100644 drivers/watchdog/Makefile
 create mode 100644 drivers/watchdog/at91sam9_wdt.c
 create mode 100644 include/asm-arm/arch-at91/at91_wdt.h
Makefile +1 -0
index 1cce381..d774e2e 100644
@@ -264,6 +264,7 @@ LIBS += drivers/rtc/librtc.a
 LIBS += drivers/serial/libserial.a
 LIBS += drivers/usb/libusb.a
 LIBS += drivers/video/libvideo.a
+LIBS += drivers/watchdog/libwatchdog.a
 LIBS += common/libcommon.a
 LIBS += libfdt/libfdt.a
 LIBS += api/libapi.a
doc/README.at91 +11 -0
index e460e66..9b4eae6 100644
@@ -2,6 +2,7 @@ Atmel AT91 Evaluation kits
 
 http://atmel.com/dyn/products/tools.asp?family_id=605#1443
 
+I. Board mapping & boot media
 ------------------------------------------------------------------------------
 AT91SAM9260EK, AT91SAM9G20EK & AT91SAM9XEEK
 ------------------------------------------------------------------------------
@@ -86,3 +87,13 @@ Environment variables
 		make at91sam9263ek_config		- use data flash (spi cs0) (default)
 		make at91sam9263ek_nandflash_config	- use nand flash
 		make at91sam9263ek_dataflash_cs0_config	- use data flash (spi cs0)
+
+II. Watchdog support
+
+	For security reasons, the at91 watchdog is running at boot time and,
+	if deactivated, cannot be used anymore.
+	If you want to use the watchdog, you will need to keep it running in
+	your code (make sure not to disable it in AT91Bootstrap for instance).
+
+	In the U-Boot configuration, the AT91 watchdog support is enabled using
+	the CONFIG_AT91SAM9_WATCHDOG and CONFIG_HW_WATCHDOG options.
drivers/serial/atmel_usart.c +3 -1
index f3b146c..f50552a 100644
@@ -16,6 +16,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include <common.h>
+#include <watchdog.h>
 
 #include <asm/io.h>
 #include <asm/arch/clk.h>
@@ -87,7 +88,8 @@ void serial_puts(const char *s)
 
 int serial_getc(void)
 {
-	while (!(usart3_readl(CSR) & USART3_BIT(RXRDY))) ;
+	while (!(usart3_readl(CSR) & USART3_BIT(RXRDY)))
+		 WATCHDOG_RESET();
 	return usart3_readl(RHR);
 }
 
drivers/watchdog/Makefile new file +46 -0

46 lines not on this page · raw message

drivers/watchdog/at91sam9_wdt.c new file +79 -0

79 lines not on this page · raw message

include/asm-arm/arch-at91/at91_wdt.h new file +38 -0
new file mode 100644
index 0000000..7e18537
@@ -0,0 +1,38 @@
+/*
+ * [origin: Linux kernel arch/arm/mach-at91/include/mach/at91_wdt.h]
+ *
+ * Copyright (C) 2008 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
+ * Copyright (C) 2007 Andrew Victor
+ * Copyright (C) 2007 Atmel Corporation.
+ *
+ * Watchdog Timer (WDT) - System peripherals regsters.
+ * Based on AT91SAM9261 datasheet revision D.
+ *
+ * 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.
+ */
+
+#ifndef AT91_WDT_H
+#define AT91_WDT_H
+
+#define AT91_WDT_CR		(AT91_WDT + 0x00)	/* Watchdog Control Register */
+#define		AT91_WDT_WDRSTT		(1    << 0)		/* Restart */
+#define		AT91_WDT_KEY		(0xa5 << 24)		/* KEY Password */
+
+#define AT91_WDT_MR		(AT91_WDT + 0x04)	/* Watchdog Mode Register */
+#define		AT91_WDT_WDV		(0xfff << 0)		/* Counter Value */
+#define		AT91_WDT_WDFIEN		(1     << 12)		/* Fault Interrupt Enable */
+#define		AT91_WDT_WDRSTEN	(1     << 13)		/* Reset Processor */
+#define		AT91_WDT_WDRPROC	(1     << 14)		/* Timer Restart */
+#define		AT91_WDT_WDDIS		(1     << 15)		/* Watchdog Disable */
+#define		AT91_WDT_WDD		(0xfff << 16)		/* Delta Value */
+#define		AT91_WDT_WDDBGHLT	(1     << 28)		/* Debug Halt */
+#define		AT91_WDT_WDIDLEHLT	(1     << 29)		/* Idle Halt */
+
+#define AT91_WDT_SR		(AT91_WDT + 0x08)	/* Watchdog Status Register */
+#define		AT91_WDT_WDUNF		(1 << 0)		/* Watchdog Underflow */
+#define		AT91_WDT_WDERR		(1 << 1)		/* Watchdog Error */
+
+#endif
Signature · 1 line
1.6.2.1
#2 lore raw

PATCH 3/13 at91: rename DATAFLASH_MMC_SELECT to CONFIG_DATAFLASH_MMC_SELECT

---
 board/atmel/at91rm9200dk/mux.c |   74 ++++++++++++++++++++--------------------
 cpu/arm926ejs/at91/.gitignore  |    5 +++
 include/at45.h                 |    2 +-
 3 files changed, 43 insertions(+), 38 deletions(-)
 rewrite board/atmel/at91rm9200dk/mux.c (69%)
 create mode 100644 cpu/arm926ejs/at91/.gitignore
board/atmel/at91rm9200dk/mux.c +37 -37
dissimilarity index 69%
index 767d280..5e03673 100644
@@ -1,37 +1,37 @@
-#include <config.h>
-#include <common.h>
-#include <asm/hardware.h>
-#include <dataflash.h>
-
-int AT91F_GetMuxStatus(void) {
-#ifdef	DATAFLASH_MMC_SELECT
-	AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT; /* Set in PIO mode */
-	AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT; /* Configure in output */
-
-
-	if(AT91C_BASE_PIOB->PIO_ODSR & DATAFLASH_MMC_SELECT) {
-		return 1;
-	} else {
-		return 0;
-	}
-#endif
-	return 0;
-}
-
-void AT91F_SelectMMC(void) {
-#ifdef	DATAFLASH_MMC_SELECT
-	AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT;	/* Set in PIO mode */
-	AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT;	/* Configure in output */
-	/* Set Output */
-	AT91C_BASE_PIOB->PIO_SODR = DATAFLASH_MMC_SELECT;
-#endif
-}
-
-void AT91F_SelectSPI(void) {
-#ifdef	DATAFLASH_MMC_SELECT
-	AT91C_BASE_PIOB->PIO_PER = DATAFLASH_MMC_SELECT;	/* Set in PIO mode */
-	AT91C_BASE_PIOB->PIO_OER = DATAFLASH_MMC_SELECT;	/* Configure in output */
-	/* Clear Output */
-	AT91C_BASE_PIOB->PIO_CODR = DATAFLASH_MMC_SELECT;
-#endif
-}
+#include <config.h>
+#include <common.h>
+#include <asm/hardware.h>
+#include <dataflash.h>
+
+int AT91F_GetMuxStatus(void) {
+#ifdef	CONFIG_DATAFLASH_MMC_SELECT
+	AT91C_BASE_PIOB->PIO_PER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Set in PIO mode */
+	AT91C_BASE_PIOB->PIO_OER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Configure in output */
+
+
+	if(AT91C_BASE_PIOB->PIO_ODSR & CONFIG_SYS_DATAFLASH_MMC_PIO) {
+		return 1;
+	} else {
+		return 0;
+	}
+#endif
+	return 0;
+}
+
+void AT91F_SelectMMC(void) {
+#ifdef	CONFIG_DATAFLASH_MMC_SELECT
+	AT91C_BASE_PIOB->PIO_PER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Set in PIO mode */
+	AT91C_BASE_PIOB->PIO_OER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Configure in output */
+	/* Set Output */
+	AT91C_BASE_PIOB->PIO_SODR = CONFIG_SYS_DATAFLASH_MMC_PIO;
+#endif
+}
+
+void AT91F_SelectSPI(void) {
+#ifdef	CONFIG_DATAFLASH_MMC_SELECT
+	AT91C_BASE_PIOB->PIO_PER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Set in PIO mode */
+	AT91C_BASE_PIOB->PIO_OER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Configure in output */
+	/* Clear Output */
+	AT91C_BASE_PIOB->PIO_CODR = CONFIG_SYS_DATAFLASH_MMC_PIO;
+#endif
+}
cpu/arm926ejs/at91/.gitignore new file +5 -0
new file mode 100644
index 0000000..8a8c3b8
@@ -0,0 +1,5 @@
+#
+# Generated files
+#
+
+/u-boot.lds
include/at45.h +1 -1
index 40bb4a0..e7e3711 100644
@@ -1,7 +1,7 @@
 
 #ifndef	_AT45_H_
 #define	_AT45_H_
-#ifdef	DATAFLASH_MMC_SELECT
+#ifdef	CONFIG_DATAFLASH_MMC_SELECT
 extern	void AT91F_SelectMMC(void);
 extern	void AT91F_SelectSPI(void);
 extern	int AT91F_GetMuxStatus(void);
Signature · 1 line
1.6.2.1
#3 lore raw

PATCH 4/13 at91rm9200dk: Move conditional compilation to Makefile

---
 board/atmel/at91rm9200dk/Makefile |   14 ++++++++++----
 board/atmel/at91rm9200dk/mux.c    |   12 ++----------
 2 files changed, 12 insertions(+), 14 deletions(-)
board/atmel/at91rm9200dk/Makefile +10 -4
index 2d806d0..79d41d6 100644
@@ -25,10 +25,16 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(BOARD).a
 
-COBJS	:= at91rm9200dk.o flash.o led.o mux.o partition.o
-
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
+COBJS-y += $(BOARD).o
+COBJS-y += flash.o
+COBJS-y += led.o
+ifdef CONFIG_HAS_DATAFLASH
+COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += mux.o
+COBJS-y += partition.o
+endif
+
+SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
 
 $(LIB):	$(obj).depend $(OBJS) $(SOBJS)
board/atmel/at91rm9200dk/mux.c +2 -10
index 5e03673..a00563e 100644
@@ -4,34 +4,26 @@
 #include <dataflash.h>
 
 int AT91F_GetMuxStatus(void) {
-#ifdef	CONFIG_DATAFLASH_MMC_SELECT
 	AT91C_BASE_PIOB->PIO_PER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Set in PIO mode */
 	AT91C_BASE_PIOB->PIO_OER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Configure in output */
 
 
-	if(AT91C_BASE_PIOB->PIO_ODSR & CONFIG_SYS_DATAFLASH_MMC_PIO) {
+	if(AT91C_BASE_PIOB->PIO_ODSR & CONFIG_SYS_DATAFLASH_MMC_PIO)
 		return 1;
-	} else {
-		return 0;
-	}
-#endif
+
 	return 0;
 }
 
 void AT91F_SelectMMC(void) {
-#ifdef	CONFIG_DATAFLASH_MMC_SELECT
 	AT91C_BASE_PIOB->PIO_PER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Set in PIO mode */
 	AT91C_BASE_PIOB->PIO_OER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Configure in output */
 	/* Set Output */
 	AT91C_BASE_PIOB->PIO_SODR = CONFIG_SYS_DATAFLASH_MMC_PIO;
-#endif
 }
 
 void AT91F_SelectSPI(void) {
-#ifdef	CONFIG_DATAFLASH_MMC_SELECT
 	AT91C_BASE_PIOB->PIO_PER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Set in PIO mode */
 	AT91C_BASE_PIOB->PIO_OER = CONFIG_SYS_DATAFLASH_MMC_PIO; /* Configure in output */
 	/* Clear Output */
 	AT91C_BASE_PIOB->PIO_CODR = CONFIG_SYS_DATAFLASH_MMC_PIO;
-#endif
 }
Signature · 1 line
1.6.2.1
#4 lore raw

PATCH 5/13 add dataflash mmc mux missing support

---
 common/Makefile                |    1 +
 common/cmd_dataflash_mmc_mux.c |   65 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_dataflash_mmc_mux.c
common/Makefile +1 -0
index 23171ca..b6f36c9 100644
@@ -70,6 +70,7 @@ COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
 COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
 COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
+COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
 COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
 ifdef CONFIG_4xx
 COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
common/cmd_dataflash_mmc_mux.c new file +65 -0

65 lines not on this page · raw message

Signature · 1 line
1.6.2.1
#5 lore raw

PATCH 6/13 Add support for the AT91RM9200EK Board.

From: Ulf Samuelsson <[email protected]>

The AT91RM9200-EK Evaluation Board supports the AT91RM9200 ARM9-based 32-bit RISC microcontroller and enables real-time code development and evaluation.

Here is the chip page on Atmel website:
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507

with
- NOR (cfi driver)
- DataFlash
- USB OHCI
- Net
- I2C (hard)

---
 MAKEALL                                 |    1 +
 Makefile                                |    3 +
 board/atmel/at91rm9200ek/Makefile       |   56 ++++++
 board/atmel/at91rm9200ek/at91rm9200ek.c |   86 ++++++++
 board/atmel/at91rm9200ek/config.mk      |    1 +
 board/atmel/at91rm9200ek/led.c          |   89 +++++++++
 board/atmel/at91rm9200ek/misc.c         |   51 +++++
 board/atmel/at91rm9200ek/mux.c          |   38 ++++
 board/atmel/at91rm9200ek/partition.c    |   38 ++++
 board/atmel/at91rm9200ek/u-boot.lds     |   56 ++++++
 cpu/arm920t/start.S                     |    4 +-
 drivers/mtd/cfi_flash.c                 |    5 +-
 include/configs/at91rm9200ek.h          |  326 +++++++++++++++++++++++++++++++
 13 files changed, 747 insertions(+), 7 deletions(-)
 create mode 100644 board/atmel/at91rm9200ek/Makefile
 create mode 100644 board/atmel/at91rm9200ek/at91rm9200ek.c
 create mode 100644 board/atmel/at91rm9200ek/config.mk
 create mode 100644 board/atmel/at91rm9200ek/led.c
 create mode 100644 board/atmel/at91rm9200ek/misc.c
 create mode 100644 board/atmel/at91rm9200ek/mux.c
 create mode 100644 board/atmel/at91rm9200ek/partition.c
 create mode 100644 board/atmel/at91rm9200ek/u-boot.lds
 create mode 100644 include/configs/at91rm9200ek.h
MAKEALL +1 -0
index aa7095e..89f1c55 100755
@@ -570,6 +570,7 @@ LIST_at91="		\
 	afeb9260	\
 	at91cap9adk	\
 	at91rm9200dk	\
+	at91rm9200ek	\
 	at91sam9260ek	\
 	at91sam9261ek	\
 	at91sam9263ek	\
Makefile +3 -0
index d774e2e..a9f25c9 100644
@@ -2626,6 +2626,9 @@ shannon_config	:	unconfig
 at91rm9200dk_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200dk atmel at91rm9200
 
+at91rm9200ek_config	:	unconfig
+	@$(MKCONFIG) $(@:_config=) arm arm920t at91rm9200ek atmel at91rm9200
+
 cmc_pu2_config	:	unconfig
 	@$(MKCONFIG) $(@:_config=) arm arm920t cmc_pu2 NULL at91rm9200
 
board/atmel/at91rm9200ek/Makefile new file +56 -0

56 lines not on this page · raw message

board/atmel/at91rm9200ek/at91rm9200ek.c new file +86 -0

86 lines not on this page · raw message

board/atmel/at91rm9200ek/config.mk new file +1 -0
new file mode 100644
index 0000000..9ce161e
@@ -0,0 +1 @@
+TEXT_BASE = 0x21f00000
board/atmel/at91rm9200ek/led.c new file +89 -0

89 lines not on this page · raw message

board/atmel/at91rm9200ek/misc.c new file +51 -0

51 lines not on this page · raw message

board/atmel/at91rm9200ek/mux.c new file +38 -0
new file mode 100644
index 0000000..bdd44e8
@@ -0,0 +1,38 @@
+#include <config.h>
+#include <common.h>
+#include <asm/hardware.h>
+#include <asm/io.h>
+#include <dataflash.h>
+
+int AT91F_GetMuxStatus(void)
+{
+	/* Set in PIO mode */
+	writel(CONFIG_SYS_DATAFLASH_MMC_PIO, AT91C_BASE_PIOB->PIO_PER);
+	/* Configure in output */
+	writel(CONFIG_SYS_DATAFLASH_MMC_PIO, AT91C_BASE_PIOB->PIO_OER);
+
+	if(readl(AT91C_BASE_PIOB->PIO_ODSR) & CONFIG_SYS_DATAFLASH_MMC_PIO)
+		return 1;
+
+	return 0;
+}
+
+void AT91F_SelectMMC(void)
+{
+	/* Set in PIO mode */
+	writel(CONFIG_SYS_DATAFLASH_MMC_PIO, AT91C_BASE_PIOB->PIO_PER);
+	/* Configure in output */
+	writel(CONFIG_SYS_DATAFLASH_MMC_PIO, AT91C_BASE_PIOB->PIO_OER);
+	/* Set Output */
+	writel(CONFIG_SYS_DATAFLASH_MMC_PIO, AT91C_BASE_PIOB->PIO_SODR);
+}
+
+void AT91F_SelectSPI(void)
+{
+	/* Set in PIO mode */
+	writel(CONFIG_SYS_DATAFLASH_MMC_PIO, AT91C_BASE_PIOB->PIO_PER);
+	/* Configure in output */
+	writel(CONFIG_SYS_DATAFLASH_MMC_PIO, AT91C_BASE_PIOB->PIO_OER);
+	/* Clear Output */
+	writel(CONFIG_SYS_DATAFLASH_MMC_PIO, AT91C_BASE_PIOB->PIO_CODR);
+}
board/atmel/at91rm9200ek/partition.c new file +38 -0
new file mode 100644
index 0000000..990cbcf
@@ -0,0 +1,38 @@
+/*
+ *
+ * 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
+ *
+ */
+#include <common.h>
+#include <config.h>
+#include <asm/hardware.h>
+#include <dataflash.h>
+
+AT91S_DATAFLASH_INFO dataflash_info[CONFIG_SYS_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS] = {
+	{CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
+	{CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3, 3}
+};
+
+/*define the area offsets*/
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,	0, "Bootstrap"},
+	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR,	0, "Environment"},
+	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,	0, "U-Boot"},
+	{0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR,	0, "Kernel"},
+	{0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR,	0, "FS"},
+};
board/atmel/at91rm9200ek/u-boot.lds new file +56 -0

56 lines not on this page · raw message

cpu/arm920t/start.S +1 -3
index fbcfe6d..f610e9f 100644
@@ -258,11 +258,9 @@ cpu_init_crit:
 	 * find a lowlevel_init.S in your board directory.
 	 */
 	mov	ip, lr
-#if	defined(CONFIG_AT91RM9200EK)
 
-#else
 	bl	lowlevel_init
-#endif
+
 	mov	lr, ip
 	mov	pc, lr
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
drivers/mtd/cfi_flash.c +1 -4
index 631b969..175d82a 100644
@@ -1788,13 +1788,10 @@ static void flash_fixup_atmel(flash_info_t *info, struct cfi_qry *qry)
 
 	/* AT49BV6416(T) list the erase regions in the wrong order.
 	 * However, the device ID is identical with the non-broken
-	 * AT49BV642D since u-boot only reads the low byte (they
-	 * differ in the high byte.) So leave out this fixup for now.
+	 * AT49BV642D they differ in the high byte.
 	 */
-#if 0
 	if (info->device_id == 0xd6 || info->device_id == 0xd2)
 		reverse_geometry = !reverse_geometry;
-#endif
 
 	if (reverse_geometry)
 		cfi_reverse_geometry(qry);
include/configs/at91rm9200ek.h new file +326 -0

326 lines not on this page · raw message

Signature · 1 line
1.6.2.1
#6 lore raw

PATCH 7/13 at91rm9200: move serial driver to drivers/serial

add CONFIG_AT91RM9200_USART to activate the driver

---
 cpu/arm920t/at91rm9200/Makefile                    |    2 +-
 drivers/serial/Makefile                            |    1 +
 .../serial.c => drivers/serial/at91rm9200_usart.c  |    0
 include/configs/at91rm9200dk.h                     |    1 +
 include/configs/at91rm9200ek.h                     |    1 +
 include/configs/cmc_pu2.h                          |    1 +
 include/configs/csb637.h                           |    1 +
 include/configs/kb9202.h                           |    1 +
 include/configs/m501sk.h                           |    1 +
 include/configs/mp2usb.h                           |    1 +
 10 files changed, 9 insertions(+), 1 deletions(-)
 rename cpu/arm920t/at91rm9200/serial.c => drivers/serial/at91rm9200_usart.c (100%)
cpu/arm920t/at91rm9200/Makefile +1 -1
index ab4c52c..67f17fa 100644
@@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(SOC).a
 
 COBJS	= bcm5221.o dm9161.o ether.o i2c.o interrupts.o \
-	  lxt972.o serial.o usb.o spi.o
+	  lxt972.o usb.o spi.o
 SOBJS	= lowlevel_init.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
drivers/serial/Makefile +1 -0
index d0efd73..465b29f 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	:= $(obj)libserial.a
 
 COBJS-$(CONFIG_ARM_DCC) += arm_dcc.o
+COBJS-$(CONFIG_AT91RM9200_USART) += at91rm9200_usart.o
 COBJS-$(CONFIG_ATMEL_USART) += atmel_usart.o
 COBJS-$(CONFIG_MCFUART) += mcfuart.o
 COBJS-$(CONFIG_NS9750_UART) += ns9750_serial.o
drivers/serial/at91rm9200_usart.c renamed from cpu/arm920t/at91rm9200/serial.c +0 -0
similarity index 100%
rename from cpu/arm920t/at91rm9200/serial.c
rename to drivers/serial/at91rm9200_usart.c
include/configs/at91rm9200dk.h +1 -0
index 5a980d3..56128c1 100644
@@ -88,6 +88,7 @@
  */
 
 /* define one of these to choose the DBGU, USART0  or USART1 as console */
+#define CONFIG_AT91RM9200_USART
 #define CONFIG_DBGU
 #undef CONFIG_USART0
 #undef CONFIG_USART1
include/configs/at91rm9200ek.h +1 -0
index 692ccdb..a018873 100644
@@ -112,6 +112,7 @@
  * define one of these to choose the DBGU,
  * USART0 or USART1 as console
  */
+#define CONFIG_AT91RM9200_USART
 #define CONFIG_DBGU
 #undef CONFIG_USART0
 #undef CONFIG_USART1
include/configs/cmc_pu2.h +1 -0
index e5c74e1..80559bf 100644
@@ -88,6 +88,7 @@
  */
 
 /* define one of these to choose the DBGU, USART0  or USART1 as console */
+#define CONFIG_AT91RM9200_USART
 #undef CONFIG_DBGU
 #define CONFIG_USART0
 #undef CONFIG_USART1
include/configs/csb637.h +1 -0
index 761c0dc..e1cdc7f 100644
@@ -90,6 +90,7 @@
  */
 
 /* define one of these to choose the DBGU, USART0  or USART1 as console */
+#define CONFIG_AT91RM9200_USART
 #define CONFIG_DBGU
 #undef CONFIG_USART0
 #undef CONFIG_USART1
include/configs/kb9202.h +1 -0
index 1ce8c69..7dd81e6 100644
@@ -72,6 +72,7 @@
  */
 
 /* define one of these to choose the DBGU, USART0  or USART1 as console */
+#define CONFIG_AT91RM9200_USART
 #define CONFIG_DBGU
 #undef CONFIG_USART0
 #undef CONFIG_USART1
include/configs/m501sk.h +1 -0
index a432850..1e7d90e 100644
@@ -110,6 +110,7 @@
 #define CONFIG_CMC_PU2
 
 /* define one of these to choose the DBGU, USART0  or USART1 as console */
+#define CONFIG_AT91RM9200_USART
 #define CONFIG_DBGU
 #undef CONFIG_USART0
 #undef CONFIG_USART1
include/configs/mp2usb.h +1 -0
index 9ac7e9a..b78fc76 100644
@@ -95,6 +95,7 @@
  */
 
 /* define one of these to choose the DBGU, USART0  or USART1 as console */
+#define CONFIG_AT91RM9200_USART
 #define CONFIG_DBGU
 #undef CONFIG_USART0
 #undef CONFIG_USART1
Signature · 1 line
1.6.2.1
#7 lore raw

PATCH 8/13 at91rm9200: move serial shutdown code to serial drivers

introduce serial_exit for this purpose. Use it only when the rm9200 serial driver is active

---
 cpu/arm920t/at91rm9200/interrupts.c |   13 +++----------
 drivers/serial/at91rm9200_usart.c   |    5 +++++
 include/common.h                    |    1 +
 3 files changed, 9 insertions(+), 10 deletions(-)
cpu/arm920t/at91rm9200/interrupts.c +3 -10
index 5f0703c..15e22bf 100644
@@ -166,21 +166,14 @@ ulong get_tbclk (void)
 void reset_cpu (ulong ignored)
 {
 
-#ifdef CONFIG_DBGU
-	AT91PS_USART us = (AT91PS_USART) AT91C_BASE_DBGU;
-#endif
-#ifdef CONFIG_USART0
-	AT91PS_USART us = AT91C_BASE_US0;
-#endif
-#ifdef CONFIG_USART1
-	AT91PS_USART us = AT91C_BASE_US1;
-#endif
 #ifdef CONFIG_AT91RM9200DK
 	AT91PS_PIO pio = AT91C_BASE_PIOA;
 #endif
 
+#if defined(CONFIG_AT91RM9200_USART)
 	/*shutdown the console to avoid strange chars during reset */
-	us->US_CR = (AT91C_US_RSTRX | AT91C_US_RSTTX);
+	serial_exit();
+#endif
 
 #ifdef CONFIG_AT91RM9200DK
 	/* Clear PA19 to trigger the hard reset */
drivers/serial/at91rm9200_usart.c +5 -0
index d563445..858bde9 100644
@@ -86,6 +86,11 @@ int serial_init (void)
 	return (0);
 }
 
+void serial_exit (void)
+{
+	us->US_CR = (AT91C_US_RSTRX | AT91C_US_RSTTX);
+}
+
 void serial_putc (const char c)
 {
 	if (c == '\n')
include/common.h +1 -0
index 952ddff..43068e6 100644
@@ -453,6 +453,7 @@ void ft_pci_setup(void *blob, bd_t *bd);
 
 /* $(CPU)/serial.c */
 int	serial_init   (void);
+void	serial_exit   (void);
 void	serial_addr   (unsigned int);
 void	serial_setbrg (void);
 void	serial_putc   (const char);
Signature · 1 line
1.6.2.1
#8 lore raw

PATCH 9/13 at91rm9200: Reset update

Update the rm9200 reset sequence to try executing a board-specific reset function and move specific board reset to board.

---
 board/atmel/at91rm9200dk/at91rm9200dk.c |   10 ++++++++++
 cpu/arm920t/at91rm9200/interrupts.c     |   14 ++++----------
 2 files changed, 14 insertions(+), 10 deletions(-)
board/atmel/at91rm9200dk/at91rm9200dk.c +10 -0
index b89a3fd..c761dd7 100644
@@ -54,6 +54,16 @@ int board_init (void)
 	return 0;
 }
 
+void board_reset (void)
+{
+	AT91PS_PIO pio = AT91C_BASE_PIOA;
+
+	/* Clear PA19 to trigger the hard reset */
+	writel(0x00080000, pio->PIO_CODR);
+	writel(0x00080000, pio->PIO_OER);
+	writel(0x00080000, pio->PIO_PER);
+}
+
 int dram_init (void)
 {
 	gd->bd->bi_dram[0].start = PHYS_SDRAM;
cpu/arm920t/at91rm9200/interrupts.c +4 -10
index 15e22bf..cff4916 100644
@@ -45,6 +45,8 @@ AT91PS_TC tmr;
 static ulong timestamp;
 static ulong lastinc;
 
+void board_reset(void) __attribute__((__weak__));
+
 int interrupt_init (void)
 {
 	tmr = AT91C_BASE_TC0;
@@ -166,21 +168,13 @@ ulong get_tbclk (void)
 void reset_cpu (ulong ignored)
 {
 
-#ifdef CONFIG_AT91RM9200DK
-	AT91PS_PIO pio = AT91C_BASE_PIOA;
-#endif
-
 #if defined(CONFIG_AT91RM9200_USART)
 	/*shutdown the console to avoid strange chars during reset */
 	serial_exit();
 #endif
 
-#ifdef CONFIG_AT91RM9200DK
-	/* Clear PA19 to trigger the hard reset */
-	pio->PIO_CODR = 0x00080000;
-	pio->PIO_OER  = 0x00080000;
-	pio->PIO_PER  = 0x00080000;
-#endif
+	if (board_reset)
+		board_reset();
 
 	/* this is the way Linux does it */
 
Signature · 1 line
1.6.2.1
#9 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

---
 cpu/arm926ejs/at91/Makefile                        |    1 -
 drivers/usb/Makefile                               |    1 +
 .../at91/usb.c => drivers/usb/atmel_usb.c          |    0
 include/configs/afeb9260.h                         |    1 +
 include/configs/at91cap9adk.h                      |    1 +
 include/configs/at91sam9260ek.h                    |    1 +
 include/configs/at91sam9261ek.h                    |    1 +
 include/configs/at91sam9263ek.h                    |    1 +
 8 files changed, 6 insertions(+), 1 deletions(-)
 rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c (100%)
cpu/arm926ejs/at91/Makefile +0 -1
index f9e739c..d0d47e6 100644
@@ -57,7 +57,6 @@ endif
 COBJS-$(CONFIG_AT91_LED)	+= led.o
 COBJS-$(CONFIG_HAS_DATAFLASH)	+= spi.o
 COBJS-y	+= timer.o
-COBJS-y	+= usb.o
 SOBJS	= lowlevel_init.o
 
 SRCS    := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
drivers/usb/Makefile +1 -0
index b306a65..de46b7b 100644
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
 COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
 
 # host
+COBJS-$(CONFIG_USB_ATMEL) += atmel_usb.o
 COBJS-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
 COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
 COBJS-$(CONFIG_USB_SL811HS) += sl811_usb.o
drivers/usb/atmel_usb.c renamed from cpu/arm926ejs/at91/usb.c +0 -0
similarity index 100%
rename from cpu/arm926ejs/at91/usb.c
rename to drivers/usb/atmel_usb.c
include/configs/afeb9260.h +1 -0
index 33a67ca..3a51e60 100644
@@ -122,6 +122,7 @@
 #define CONFIG_NET_RETRY_COUNT		20
 
 /* USB */
+#define CONFIG_USB_ATMEL
 #define CONFIG_USB_OHCI_NEW		1
 #define CONFIG_DOS_PARTITION		1
 #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
include/configs/at91cap9adk.h +1 -0
index 7e7f124..45af688 100644
@@ -144,6 +144,7 @@
 #define CONFIG_RESET_PHY_R		1
 
 /* USB */
+#define CONFIG_USB_ATMEL
 #define CONFIG_USB_OHCI_NEW		1
 #define CONFIG_DOS_PARTITION		1
 #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
include/configs/at91sam9260ek.h +1 -0
index 1fae3a3..18c81f6 100644
@@ -142,6 +142,7 @@
 #define CONFIG_RESET_PHY_R		1
 
 /* USB */
+#define CONFIG_USB_ATMEL
 #define CONFIG_USB_OHCI_NEW		1
 #define CONFIG_DOS_PARTITION		1
 #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
include/configs/at91sam9261ek.h +1 -0
index 752d7e9..5c94407 100644
@@ -143,6 +143,7 @@
 #define CONFIG_RESET_PHY_R		1
 
 /* USB */
+#define CONFIG_USB_ATMEL
 #define CONFIG_USB_OHCI_NEW		1
 #define CONFIG_DOS_PARTITION		1
 #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
include/configs/at91sam9263ek.h +1 -0
index dd500ca..d77a780 100644
@@ -150,6 +150,7 @@
 #define CONFIG_RESET_PHY_R		1
 
 /* USB */
+#define CONFIG_USB_ATMEL
 #define CONFIG_USB_OHCI_NEW		1
 #define CONFIG_DOS_PARTITION		1
 #define CONFIG_SYS_USB_OHCI_CPU_INIT		1
Signature · 1 line
1.6.2.1
#10 lore raw

PATCH 11/13 at91: move dataflash spi driver to drivers/spi

---
 cpu/arm926ejs/at91/Makefile                        |    1 -
 drivers/spi/Makefile                               |    1 +
 .../spi.c => drivers/spi/atmel_dataflash_spi.c     |    0
 include/configs/afeb9260.h                         |    1 +
 include/configs/at91cap9adk.h                      |    1 +
 include/configs/at91sam9260ek.h                    |    1 +
 include/configs/at91sam9261ek.h                    |    1 +
 include/configs/at91sam9263ek.h                    |    1 +
 include/configs/at91sam9rlek.h                     |    1 +
 9 files changed, 7 insertions(+), 1 deletions(-)
 rename cpu/arm926ejs/at91/spi.c => drivers/spi/atmel_dataflash_spi.c (100%)
cpu/arm926ejs/at91/Makefile +0 -1
index d0d47e6..34e7461 100644
@@ -55,7 +55,6 @@ COBJS-y				+= at91sam9rl_serial.o
 COBJS-$(CONFIG_HAS_DATAFLASH)	+= at91sam9rl_spi.o
 endif
 COBJS-$(CONFIG_AT91_LED)	+= led.o
-COBJS-$(CONFIG_HAS_DATAFLASH)	+= spi.o
 COBJS-y	+= timer.o
 SOBJS	= lowlevel_init.o
 
drivers/spi/Makefile +1 -0
index 6e2c121..1350f3e 100644
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libspi.a
 
+COBJS-$(CONFIG_ATMEL_DATAFLASH_SPI) += atmel_dataflash_spi.o
 COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
 COBJS-$(CONFIG_BFIN_SPI) += bfin_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
drivers/spi/atmel_dataflash_spi.c renamed from cpu/arm926ejs/at91/spi.c +0 -0
similarity index 100%
rename from cpu/arm926ejs/at91/spi.c
rename to drivers/spi/atmel_dataflash_spi.c
include/configs/afeb9260.h +1 -0
index 3a51e60..bcd8d35 100644
@@ -87,6 +87,7 @@
 #define PHYS_SDRAM_SIZE			0x04000000	/* 64 megs */
 
 /* DataFlash */
+#define CONFIG_ATMEL_DATAFLASH_SPI
 #define CONFIG_HAS_DATAFLASH		1
 #define CONFIG_SYS_SPI_WRITE_TOUT		(5 * CONFIG_SYS_HZ)
 #define CONFIG_SYS_MAX_DATAFLASH_BANKS		2
include/configs/at91cap9adk.h +1 -0
index 45af688..af81f1d 100644
@@ -107,6 +107,7 @@
 #define PHYS_SDRAM_SIZE			0x04000000	/* 64 megs */
 
 /* DataFlash */
+#define CONFIG_ATMEL_DATAFLASH_SPI
 #define CONFIG_HAS_DATAFLASH		1
 #define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
 #define CONFIG_SYS_MAX_DATAFLASH_BANKS		1
include/configs/at91sam9260ek.h +1 -0
index 18c81f6..ac58f27 100644
@@ -103,6 +103,7 @@
 #define PHYS_SDRAM_SIZE			0x04000000	/* 64 megs */
 
 /* DataFlash */
+#define CONFIG_ATMEL_DATAFLASH_SPI
 #define CONFIG_HAS_DATAFLASH		1
 #define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
 #define CONFIG_SYS_MAX_DATAFLASH_BANKS		2
include/configs/at91sam9261ek.h +1 -0
index 5c94407..57bb9fa 100644
@@ -107,6 +107,7 @@
 #define PHYS_SDRAM_SIZE			0x04000000	/* 64 megs */
 
 /* DataFlash */
+#define CONFIG_ATMEL_DATAFLASH_SPI
 #define CONFIG_HAS_DATAFLASH		1
 #define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
 #define CONFIG_SYS_MAX_DATAFLASH_BANKS		2
include/configs/at91sam9263ek.h +1 -0
index d77a780..dd0d552 100644
@@ -108,6 +108,7 @@
 #define PHYS_SDRAM_SIZE			0x04000000	/* 64 megs */
 
 /* DataFlash */
+#define CONFIG_ATMEL_DATAFLASH_SPI
 #define CONFIG_HAS_DATAFLASH		1
 #define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
 #define CONFIG_SYS_MAX_DATAFLASH_BANKS		1
include/configs/at91sam9rlek.h +1 -0
index 7a4039c..cef98e4 100644
@@ -98,6 +98,7 @@
 #define PHYS_SDRAM_SIZE			0x04000000	/* 64 megs */
 
 /* DataFlash */
+#define CONFIG_ATMEL_DATAFLASH_SPI
 #define CONFIG_HAS_DATAFLASH		1
 #define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
 #define CONFIG_SYS_MAX_DATAFLASH_BANKS		1
Signature · 1 line
1.6.2.1
#11 lore raw

PATCH 12/13 at91: add hardware i2c drivers

---
 cpu/arm926ejs/at91/Makefile                        |    6 +
 .../arm926ejs/at91/at91cap9_i2c.c                  |   31 ++--
 .../arm926ejs/at91/at91sam9260_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9261_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9263_i2c.c               |   31 ++--
 .../clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c   |   37 ++--
 drivers/i2c/Makefile                               |    1 +
 drivers/i2c/atmel_i2c.c                            |  234 ++++++++++++++++++++
 include/asm-arm/arch-at91/at91_common.h            |    2 +
 include/asm-arm/arch-at91/at91_twi.h               |   68 ++++++
 include/asm-arm/arch-at91/clk.h                    |    4 +
 include/asm-arm/arch-at91/hardware.h               |    5 +
 12 files changed, 405 insertions(+), 76 deletions(-)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91cap9_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9260_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9261_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9263_i2c.c (61%)
 copy include/asm-arm/arch-at91/clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c (52%)
 create mode 100644 drivers/i2c/atmel_i2c.c
 create mode 100644 include/asm-arm/arch-at91/at91_twi.h
cpu/arm926ejs/at91/Makefile +6 -0
index 34e7461..d37814f 100644
@@ -26,31 +26,37 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(SOC).a
 
 ifdef CONFIG_AT91CAP9
+COBJS-$(CONFIG_HARD_I2C)	+= at91cap9_i2c.o
 COBJS-$(CONFIG_MACB)		+= at91cap9_macb.o
 COBJS-y				+= at91cap9_serial.o
 COBJS-$(CONFIG_HAS_DATAFLASH)	+= at91cap9_spi.o
 endif
 ifdef CONFIG_AT91SAM9260
+COBJS-$(CONFIG_HARD_I2C)	+= at91sam9260_i2c.o
 COBJS-$(CONFIG_MACB)		+= at91sam9260_macb.o
 COBJS-y				+= at91sam9260_serial.o
 COBJS-$(CONFIG_HAS_DATAFLASH)	+= at91sam9260_spi.o
 endif
 ifdef CONFIG_AT91SAM9G20
+COBJS-$(CONFIG_HARD_I2C)	+= at91sam9260_i2c.o
 COBJS-$(CONFIG_MACB)		+= at91sam9260_macb.o
 COBJS-y				+= at91sam9260_serial.o
 COBJS-$(CONFIG_HAS_DATAFLASH)	+= at91sam9260_spi.o
 endif
 ifdef CONFIG_AT91SAM9261
+COBJS-$(CONFIG_HARD_I2C)	+= at91sam9261_i2c.o
 COBJS-y				+= at91sam9261_serial.o
 COBJS-$(CONFIG_HAS_DATAFLASH)	+= at91sam9261_spi.o
 endif
 ifdef CONFIG_AT91SAM9263
+COBJS-$(CONFIG_HARD_I2C)	+= at91sam9263_i2c.o
 COBJS-$(CONFIG_MACB)		+= at91sam9263_macb.o
 COBJS-y				+= at91sam9263_serial.o
 COBJS-$(CONFIG_HAS_DATAFLASH)	+= at91sam9263_spi.o
 COBJS-$(CONFIG_USB_OHCI_NEW)	+= at91sam9263_usb.o
 endif
 ifdef CONFIG_AT91SAM9RL
+COBJS-$(CONFIG_HARD_I2C)	+= at91sam9rl_i2c.o
 COBJS-y				+= at91sam9rl_serial.o
 COBJS-$(CONFIG_HAS_DATAFLASH)	+= at91sam9rl_spi.o
 endif
cpu/arm926ejs/at91/at91cap9_i2c.c renamed from include/asm-arm/arch-at91/at91_common.h +16 -15
similarity index 61%
copy from include/asm-arm/arch-at91/at91_common.h
copy to cpu/arm926ejs/at91/at91cap9_i2c.c
index 9c4e019..feb65bf 100644
@@ -1,7 +1,6 @@
 /*
- * (C) Copyright 2007-2008
- * Stelian Pop <[email protected]>
- * Lead Tech Design <www.leadtechdesign.com>
+ * (C) Copyright 2009
+ * Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -22,17 +21,19 @@
  * MA 02111-1307 USA
  */
 
-#ifndef AT91_COMMON_H
-#define AT91_COMMON_H
+#include <common.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
 
-void at91_macb_hw_init(void);
-void at91_serial_hw_init(void);
-void at91_serial0_hw_init(void);
-void at91_serial1_hw_init(void);
-void at91_serial2_hw_init(void);
-void at91_serial3_hw_init(void);
-void at91_spi0_hw_init(unsigned long cs_mask);
-void at91_spi1_hw_init(unsigned long cs_mask);
-void at91_uhp_hw_init(void);
+void at91_twi0_hw_init(void)
+{
+	at91_set_B_periph(AT91_PIN_PB4, 0);	/* TWD */
+	at91_set_multi_drive(AT91_PIN_PB4, 1);
 
-#endif /* AT91_COMMON_H */
+	at91_set_5_periph(AT91_PIN_PB5, 0);	/* TWCK */
+	at91_set_multi_drive(AT91_PIN_PB5, 1);
+
+	at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_TWI);
+}
cpu/arm926ejs/at91/at91sam9260_i2c.c renamed from include/asm-arm/arch-at91/at91_common.h +16 -15
similarity index 61%
copy from include/asm-arm/arch-at91/at91_common.h
copy to cpu/arm926ejs/at91/at91sam9260_i2c.c
index 9c4e019..ff8659f 100644
@@ -1,7 +1,6 @@
 /*
- * (C) Copyright 2007-2008
- * Stelian Pop <[email protected]>
- * Lead Tech Design <www.leadtechdesign.com>
+ * (C) Copyright 2009
+ * Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -22,17 +21,19 @@
  * MA 02111-1307 USA
  */
 
-#ifndef AT91_COMMON_H
-#define AT91_COMMON_H
+#include <common.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
 
-void at91_macb_hw_init(void);
-void at91_serial_hw_init(void);
-void at91_serial0_hw_init(void);
-void at91_serial1_hw_init(void);
-void at91_serial2_hw_init(void);
-void at91_serial3_hw_init(void);
-void at91_spi0_hw_init(unsigned long cs_mask);
-void at91_spi1_hw_init(unsigned long cs_mask);
-void at91_uhp_hw_init(void);
+void at91_twi0_hw_init(void)
+{
+	at91_set_A_periph(AT91_PIN_PA23, 0);	/* TWD */
+	at91_set_multi_drive(AT91_PIN_PA23, 1);
 
-#endif /* AT91_COMMON_H */
+	at91_set_A_periph(AT91_PIN_PA24, 0);	/* TWCK */
+	at91_set_multi_drive(AT91_PIN_PA24, 1);
+
+	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_TWI);
+}
cpu/arm926ejs/at91/at91sam9261_i2c.c renamed from include/asm-arm/arch-at91/at91_common.h +16 -15
similarity index 61%
copy from include/asm-arm/arch-at91/at91_common.h
copy to cpu/arm926ejs/at91/at91sam9261_i2c.c
index 9c4e019..5873e10 100644
@@ -1,7 +1,6 @@
 /*
- * (C) Copyright 2007-2008
- * Stelian Pop <[email protected]>
- * Lead Tech Design <www.leadtechdesign.com>
+ * (C) Copyright 2009
+ * Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -22,17 +21,19 @@
  * MA 02111-1307 USA
  */
 
-#ifndef AT91_COMMON_H
-#define AT91_COMMON_H
+#include <common.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
 
-void at91_macb_hw_init(void);
-void at91_serial_hw_init(void);
-void at91_serial0_hw_init(void);
-void at91_serial1_hw_init(void);
-void at91_serial2_hw_init(void);
-void at91_serial3_hw_init(void);
-void at91_spi0_hw_init(unsigned long cs_mask);
-void at91_spi1_hw_init(unsigned long cs_mask);
-void at91_uhp_hw_init(void);
+void at91_twi0_hw_init(void)
+{
+	at91_set_A_periph(AT91_PIN_PA7, 0);	/* TWD */
+	at91_set_multi_drive(AT91_PIN_PA7, 1);
 
-#endif /* AT91_COMMON_H */
+	at91_set_A_periph(AT91_PIN_PA8, 0);	/* TWCK */
+	at91_set_multi_drive(AT91_PIN_PA8, 1);
+
+	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9261_ID_TWI);
+}
cpu/arm926ejs/at91/at91sam9263_i2c.c renamed from include/asm-arm/arch-at91/at91_common.h +16 -15
similarity index 61%
copy from include/asm-arm/arch-at91/at91_common.h
copy to cpu/arm926ejs/at91/at91sam9263_i2c.c
index 9c4e019..e8f63ad 100644
@@ -1,7 +1,6 @@
 /*
- * (C) Copyright 2007-2008
- * Stelian Pop <[email protected]>
- * Lead Tech Design <www.leadtechdesign.com>
+ * (C) Copyright 2009
+ * Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -22,17 +21,19 @@
  * MA 02111-1307 USA
  */
 
-#ifndef AT91_COMMON_H
-#define AT91_COMMON_H
+#include <common.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
 
-void at91_macb_hw_init(void);
-void at91_serial_hw_init(void);
-void at91_serial0_hw_init(void);
-void at91_serial1_hw_init(void);
-void at91_serial2_hw_init(void);
-void at91_serial3_hw_init(void);
-void at91_spi0_hw_init(unsigned long cs_mask);
-void at91_spi1_hw_init(unsigned long cs_mask);
-void at91_uhp_hw_init(void);
+void at91_twi0_hw_init(void)
+{
+	at91_set_A_periph(AT91_PIN_PB4, 0);	/* TWD */
+	at91_set_multi_drive(AT91_PIN_PB4, 1);
 
-#endif /* AT91_COMMON_H */
+	at91_set_A_periph(AT91_PIN_PB5, 0);	/* TWCK */
+	at91_set_multi_drive(AT91_PIN_PB5, 1);
+
+	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_TWI);
+}
cpu/arm926ejs/at91/at91sam9rl_i2c.c renamed from include/asm-arm/arch-at91/clk.h +21 -16
similarity index 52%
copy from include/asm-arm/arch-at91/clk.h
copy to cpu/arm926ejs/at91/at91sam9rl_i2c.c
index 1b502c8..f12f0fd 100644
@@ -1,7 +1,6 @@
 /*
- * (C) Copyright 2007
- * Stelian Pop <[email protected]>
- * Lead Tech Design <www.leadtechdesign.com>
+ * (C) Copyright 2009
+ * Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -21,25 +20,31 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
-#ifndef __ASM_ARM_ARCH_CLK_H__
-#define __ASM_ARM_ARCH_CLK_H__
 
-#include <asm/arch/hardware.h>
+#include <common.h>
+#include <asm/arch/at91_common.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
 
-static inline unsigned long get_macb_pclk_rate(unsigned int dev_id)
+void at91_twi0_hw_init(void)
 {
-	return AT91_MASTER_CLOCK;
-}
+	at91_set_A_periph(AT91_PIN_PA23, 0);	/* TWD */
+	at91_set_multi_drive(AT91_PIN_PA23, 1);
 
-static inline unsigned long get_usart_clk_rate(unsigned int dev_id)
-{
-	return AT91_MASTER_CLOCK;
+	at91_set_A_periph(AT91_PIN_PA24, 0);	/* TWCK */
+	at91_set_multi_drive(AT91_PIN_PA24, 1);
+
+	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9RL_ID_TWI0);
 }
 
-static inline unsigned long get_lcdc_clk_rate(unsigned int dev_id)
+void at91_twi1_hw_init(void)
 {
-	return AT91_MASTER_CLOCK;
-}
+	at91_set_A_periph(AT91_PIN_PD10, 0);	/* TWD */
+	at91_set_multi_drive(AT91_PIN_PD10, 1);
 
+	at91_set_A_periph(AT91_PIN_PD11, 0);	/* TWCK */
+	at91_set_multi_drive(AT91_PIN_PD11, 1);
 
-#endif /* __ASM_ARM_ARCH_CLK_H__ */
+	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9RL_ID_TWI1);
+}
drivers/i2c/Makefile +1 -0
index 9c74657..27a5251 100644
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libi2c.a
 
+COBJS-$(CONFIG_I2C_ATMEL) += atmel_i2c.o
 COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
 COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
drivers/i2c/atmel_i2c.c new file +234 -0

234 lines not on this page · raw message

include/asm-arm/arch-at91/at91_common.h +2 -0
index 9c4e019..43a5e07 100644
@@ -33,6 +33,8 @@ void at91_serial2_hw_init(void);
 void at91_serial3_hw_init(void);
 void at91_spi0_hw_init(unsigned long cs_mask);
 void at91_spi1_hw_init(unsigned long cs_mask);
+void at91_twi0_hw_init(void);
+void at91_twi1_hw_init(void);
 void at91_uhp_hw_init(void);
 
 #endif /* AT91_COMMON_H */
include/asm-arm/arch-at91/at91_twi.h new file +68 -0

68 lines not on this page · raw message

include/asm-arm/arch-at91/clk.h +4 -0
index 1b502c8..85ab68e 100644
@@ -41,5 +41,9 @@ static inline unsigned long get_lcdc_clk_rate(unsigned int dev_id)
 	return AT91_MASTER_CLOCK;
 }
 
+static inline unsigned long get_twi_clk_rate(unsigned int dev_id)
+{
+	return AT91_MASTER_CLOCK;
+}
 
 #endif /* __ASM_ARM_ARCH_CLK_H__ */
include/asm-arm/arch-at91/hardware.h +5 -0
index 4f0e1a7..f34071c 100644
@@ -21,25 +21,30 @@
 #elif defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9G20)
 #include <asm/arch/at91sam9260.h>
 #define AT91_BASE_SPI	AT91SAM9260_BASE_SPI0
+#define AT91_BASE_TWI	AT91SAM9260_BASE_TWI
 #define AT91_ID_UHP	AT91SAM9260_ID_UHP
 #define AT91_PMC_UHP	AT91SAM926x_PMC_UHP
 #elif defined(CONFIG_AT91SAM9261)
 #include <asm/arch/at91sam9261.h>
 #define AT91_BASE_SPI	AT91SAM9261_BASE_SPI0
+#define AT91_BASE_TWI	AT91SAM9261_BASE_TWI
 #define AT91_ID_UHP	AT91SAM9261_ID_UHP
 #define AT91_PMC_UHP	AT91SAM926x_PMC_UHP
 #elif defined(CONFIG_AT91SAM9263)
 #include <asm/arch/at91sam9263.h>
 #define AT91_BASE_SPI	AT91SAM9263_BASE_SPI0
+#define AT91_BASE_TWI	AT91SAM9263_BASE_TWI
 #define AT91_ID_UHP	AT91SAM9263_ID_UHP
 #define AT91_PMC_UHP	AT91SAM926x_PMC_UHP
 #elif defined(CONFIG_AT91SAM9RL)
 #include <asm/arch/at91sam9rl.h>
 #define AT91_BASE_SPI	AT91SAM9RL_BASE_SPI
+#define AT91_BASE_TWI	AT91SAM9RL_BASE_TWI
 #define AT91_ID_UHP	AT91SAM9RL_ID_UHP
 #elif defined(CONFIG_AT91CAP9)
 #include <asm/arch/at91cap9.h>
 #define AT91_BASE_SPI	AT91CAP9_BASE_SPI0
+#define AT91_BASE_TWI	AT91CAP9_BASE_TWI
 #define AT91_ID_UHP	AT91CAP9_ID_UHP
 #define AT91_PMC_UHP	AT91CAP9_PMC_UHP
 #elif defined(CONFIG_AT91X40)
Signature · 1 line
1.6.2.1
#12 lore raw

PATCH 13/13 at91sam9263ek: active hush and auto compelete support

---
 include/configs/at91sam9263ek.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/configs/at91sam9263ek.h +3 -0
index dd0d552..fc87241 100644
@@ -204,6 +204,9 @@
 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_LONGHELP		1
 #define CONFIG_CMDLINE_EDITING	1
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
 
 #define ROUND(A, B)		(((A) + (B)) & ~((B) - 1))
 /*
Signature · 1 line
1.6.2.1
#13 lore raw

PATCH 13/13 at91sam9263ek: active hush and auto compelete support

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 10 lines · In message <[email protected]> you wrote:
---
 include/configs/at91sam9263ek.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/configs/at91sam9263ek.h +0 -0
index dd0d552..fc87241 100644

include/configs/at91sam9263ek.h line 209

Quoted 6 lines
include/configs/at91sam9263ek.h +3 -0
@@ -204,6 +204,9 @@
 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_LONGHELP		1
 #define CONFIG_CMDLINE_EDITING	1
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "

You are not the maintainer of this board.

You are not supposed to make any such modifications without permission of the board mainteiner.

Stelian, please comment.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When properly administered, vacations do not  diminish  productivity:
for every week you're away and get nothing done, there's another when
your boss is away and you get twice as much done.  -- Daniel B. Luten
#14 lore raw

PATCH 13/13 at91sam9263ek: active hush and auto compelete support

Quoted 11 lines · Wolfgang Denk

include/configs/at91sam9263ek.h line 209

Quoted 4 lines
include/configs/at91sam9263ek.h +3 -0
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2	"> "

You are not the maintainer of this board.

You are not supposed to make any such modifications without permission of the board mainteiner.

Stelian, please comment.

In the interest of keeping the various Atmel boards uniform, I'm ok with this patch. So:

JC: please CC: me directly next time, I'm rather busy lately and not always following the posts on the mailing list...

Thanks !

Signature · 1 line
Stelian Pop <[email protected]>
#15 lore raw

PATCH 12/13 at91: add hardware i2c drivers

In reply to Jean-Christophe PLAGNIOL-VILLARD

Hello Jean,

Quoted 24 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 cpu/arm926ejs/at91/Makefile                        |    6 +
 .../arm926ejs/at91/at91cap9_i2c.c                  |   31 ++--
 .../arm926ejs/at91/at91sam9260_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9261_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9263_i2c.c               |   31 ++--
 .../clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c   |   37 ++--
 drivers/i2c/Makefile                               |    1 +
 drivers/i2c/atmel_i2c.c                            |  234 ++++++++++++++++++++
 include/asm-arm/arch-at91/at91_common.h            |    2 +
 include/asm-arm/arch-at91/at91_twi.h               |   68 ++++++
 include/asm-arm/arch-at91/clk.h                    |    4 +
 include/asm-arm/arch-at91/hardware.h               |    5 +
 12 files changed, 405 insertions(+), 76 deletions(-)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91cap9_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9260_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9261_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9263_i2c.c (61%)
 copy include/asm-arm/arch-at91/clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c (52%)
 create mode 100644 drivers/i2c/atmel_i2c.c
 create mode 100644 include/asm-arm/arch-at91/at91_twi.h

[...]

drivers/i2c/Makefile include $(TOPDIR)/config.mk · line 31

Quoted 13 lines
drivers/i2c/Makefile +1 -0
index 9c74657..27a5251 100644
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libi2c.a
 
+COBJS-$(CONFIG_I2C_ATMEL) += atmel_i2c.o
 COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
 COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o

Independent from your patch, I think we need here a common rule. Either we name in future this define "CONFIG_I2C_XXX" or "CONFIG_XXX_I2C. I vote for using "CONFIG_I2C_XXX"

Quoted 25 lines
drivers/i2c/atmel_i2c.c new file +18 -0
new file mode 100644
index 0000000..b4c5530
@@ -0,0 +1,234 @@
+/*
+ *  i2c Support for Atmel's AT91RM9200 Two-Wire Interface
+ *
+ *  (c) Rick Bronson
+ *
+ *  Borrowed heavily from original work by:
+ *  Copyright (c) 2000 Philip Edelbrock <[email protected]>
+ *
+ *  Modified to work with u-boot by (C) 2004 Gary Jennejohn garyj at denx.de
+ *
+ *  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

drivers/i2c/atmel_i2c.c line 28

Quoted 10 lines
drivers/i2c/atmel_i2c.c new file +10 -0
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+*/
+#include <common.h>
+
+#ifdef CONFIG_HARD_I2C

Why not "#if defined(CONFIG_I2C_ATMEL)" as in the Makefile?

Quoted 4 lines
drivers/i2c/atmel_i2c.c new file +3 -0
+
+#include <i2c.h>
+#include <asm/io.h>

[...]

drivers/i2c/atmel_i2c.c line 154

Quoted 8 lines
drivers/i2c/atmel_i2c.c new file +7 -0
+	if (alen > 1)
+		return 1;
+	/* XXX assume an ATMEL AT24C16 */
+	if (alen == 1) {
+#if 0 /* EEPROM code already sets this correctly */
+		chip |= (addr >> 8) & 0xff;
+#endif

please remove dead code.

Quoted 16 lines
drivers/i2c/atmel_i2c.c new file +15 -0
+		addr = addr & 0xff;
+	}
+#endif
+	return at91_xfer(chip, addr, alen, buffer, len, 1);
+}
+
+int
+i2c_write(unsigned char chip, unsigned int addr, int alen,
+	  unsigned char *buffer, int len)
+{
+#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
+	int i;
+	unsigned char *buf;
+
+	/* we only allow one address byte */

drivers/i2c/atmel_i2c.c line 179

Quoted 10 lines
drivers/i2c/atmel_i2c.c new file +10 -0
+	if (alen > 1)
+		return 1;
+	/* XXX assume an ATMEL AT24C16 */
+	if (alen == 1) {
+		buf = buffer;
+		/* do single byte writes */
+		for (i = 0; i < len; i++) {
+#if 0 /* EEPROM code already sets this correctly */
+			chip |= (addr >> 8) & 0xff;
+#endif

here too, please remove dead code.

Quoted 7 lines
drivers/i2c/atmel_i2c.c new file +6 -0
+			addr = addr & 0xff;
+			if (at91_xfer(chip, addr, alen, buf++, 1, 0))
+				return 1;
+			addr++;
+		}
+		return 0;

[...]

Quoted 23 lines
include/asm-arm/arch-at91/at91_twi.h new file +16 -0
new file mode 100644
index 0000000..bb2880f
@@ -0,0 +1,68 @@
+/*
+ * arch/arm/mach-at91/include/mach/at91_twi.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Two-wire Interface (TWI) registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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.
+ */
+
+#ifndef AT91_TWI_H

include/asm-arm/arch-at91/at91_twi.h line 26

Quoted 10 lines
include/asm-arm/arch-at91/at91_twi.h new file +10 -0
+#define AT91_TWI_H
+
+#define	AT91_TWI_CR		0x00		/* Control Register */
+#define		AT91_TWI_START		(1 <<  0)	/* Send a Start Condition */
+#define		AT91_TWI_STOP		(1 <<  1)	/* Send a Stop Condition */
+#define		AT91_TWI_MSEN		(1 <<  2)	/* Master Transfer Enable */
+#define		AT91_TWI_MSDIS		(1 <<  3)	/* Master Transfer Disable */
+#define		AT91_TWI_SVEN		(1 <<  4)	/* Slave Transfer Enable [SAM9260 only] */
+#define		AT91_TWI_SVDIS		(1 <<  5)	/* Slave Transfer Disable [SAM9260 only] */
+#define		AT91_TWI_SWRST		(1 <<  7)	/* Software Reset */

^^^^^^^^^^^^^^^
doule tabs breaks line length (this affects for the
whole file)

Quoted 33 lines
include/asm-arm/arch-at91/at91_twi.h new file +32 -0
+
+#define	AT91_TWI_MMR		0x04		/* Master Mode Register */
+#define		AT91_TWI_IADRSZ		(3    <<  8)	/* Internal Device Address Size */
+#define			AT91_TWI_IADRSZ_NO		(0 << 8)
+#define			AT91_TWI_IADRSZ_1		(1 << 8)
+#define			AT91_TWI_IADRSZ_2		(2 << 8)
+#define			AT91_TWI_IADRSZ_3		(3 << 8)
+#define		AT91_TWI_MREAD		(1    << 12)	/* Master Read Direction */
+#define		AT91_TWI_DADR		(0x7f << 16)	/* Device Address */
+
+#define	AT91_TWI_SMR		0x08		/* Slave Mode Register [SAM9260 only] */
+#define		AT91_TWI_SADR		(0x7f << 16)	/* Slave Address */
+
+#define	AT91_TWI_IADR		0x0c		/* Internal Address Register */
+
+#define	AT91_TWI_CWGR		0x10		/* Clock Waveform Generator Register */
+#define		AT91_TWI_CLDIV		(0xff <<  0)	/* Clock Low Divisor */
+#define		AT91_TWI_CHDIV		(0xff <<  8)	/* Clock High Divisor */
+#define		AT91_TWI_CKDIV		(7    << 16)	/* Clock Divider */
+
+#define	AT91_TWI_SR		0x20		/* Status Register */
+#define		AT91_TWI_TXCOMP		(1 <<  0)	/* Transmission Complete */
+#define		AT91_TWI_RXRDY		(1 <<  1)	/* Receive Holding Register Ready */
+#define		AT91_TWI_TXRDY		(1 <<  2)	/* Transmit Holding Register Ready */
+#define		AT91_TWI_SVREAD		(1 <<  3)	/* Slave Read [SAM9260 only] */
+#define		AT91_TWI_SVACC		(1 <<  4)	/* Slave Access [SAM9260 only] */
+#define		AT91_TWI_GACC		(1 <<  5)	/* General Call Access [SAM9260 only] */
+#define		AT91_TWI_OVRE		(1 <<  6)	/* Overrun Error [AT91RM9200 only] */
+#define		AT91_TWI_UNRE		(1 <<  7)	/* Underrun Error [AT91RM9200 only] */
+#define		AT91_TWI_NACK		(1 <<  8)	/* Not Acknowledged */
+#define		AT91_TWI_ARBLST		(1 <<  9)	/* Arbitration Lost [SAM9260 only] */
+#define		AT91_TWI_SCLWS		(1 << 10)	/* Clock Wait State [SAM9260 only] */

include/asm-arm/arch-at91/at91_twi.h line 68

Quoted 10 lines
include/asm-arm/arch-at91/at91_twi.h new file +10 -0
+#define		AT91_TWI_EOSACC		(1 << 11)	/* End of Slave Address [SAM9260 only] */
+
+#define	AT91_TWI_IER		0x24		/* Interrupt Enable Register */
+#define	AT91_TWI_IDR		0x28		/* Interrupt Disable Register */
+#define	AT91_TWI_IMR		0x2c		/* Interrupt Mask Register */
+#define	AT91_TWI_RHR		0x30		/* Receive Holding Register */
+#define	AT91_TWI_THR		0x34		/* Transmit Holding Register */
+
+#endif
+

bye
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany 
#16 lore raw

PATCH 12/13 at91: add hardware i2c drivers

Quoted 36 lines · Heiko Schocher

Hello Jean,

Quoted 24 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 cpu/arm926ejs/at91/Makefile                        |    6 +
 .../arm926ejs/at91/at91cap9_i2c.c                  |   31 ++--
 .../arm926ejs/at91/at91sam9260_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9261_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9263_i2c.c               |   31 ++--
 .../clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c   |   37 ++--
 drivers/i2c/Makefile                               |    1 +
 drivers/i2c/atmel_i2c.c                            |  234 ++++++++++++++++++++
 include/asm-arm/arch-at91/at91_common.h            |    2 +
 include/asm-arm/arch-at91/at91_twi.h               |   68 ++++++
 include/asm-arm/arch-at91/clk.h                    |    4 +
 include/asm-arm/arch-at91/hardware.h               |    5 +
 12 files changed, 405 insertions(+), 76 deletions(-)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91cap9_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9260_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9261_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9263_i2c.c (61%)
 copy include/asm-arm/arch-at91/clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c (52%)
 create mode 100644 drivers/i2c/atmel_i2c.c
 create mode 100644 include/asm-arm/arch-at91/at91_twi.h

[...]

Quoted 8 lines
drivers/i2c/Makefile +0 -0
index 9c74657..27a5251 100644
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libi2c.a
 
Quoted 9 lines

drivers/i2c/Makefile include $(TOPDIR)/config.mk · line 31

Quoted 5 lines
drivers/i2c/Makefile +1 -0
+COBJS-$(CONFIG_I2C_ATMEL) += atmel_i2c.o
 COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
 COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o

Independent from your patch, I think we need here a common rule. Either we name in future this define "CONFIG_I2C_XXX" or "CONFIG_XXX_I2C. I vote for using "CONFIG_I2C_XXX"

it's plan to clean up the driver CONFIG_ just before send the Kconfig patch series

Quoted 8 lines

drivers/i2c/Makefile

Quoted 6 lines

+ *

drivers/i2c/Makefile +4 -0
+*/
+#include <common.h>
+
+#ifdef CONFIG_HARD_I2C

Why not "#if defined(CONFIG_I2C_ATMEL)" as in the Makefile?

until the Kconfig I'll prefer to keep the CONFIG_HARD_I2C

Quoted 82 lines
Quoted 5 lines
drivers/i2c/Makefile +3 -0
+
+#include <i2c.h>
+#include <asm/io.h>

[...]

drivers/i2c/Makefile

Quoted 8 lines
drivers/i2c/Makefile +7 -0
+	if (alen > 1)
+		return 1;
+	/* XXX assume an ATMEL AT24C16 */
+	if (alen == 1) {
+#if 0 /* EEPROM code already sets this correctly */
+		chip |= (addr >> 8) & 0xff;
+#endif

please remove dead code.

Quoted 16 lines
drivers/i2c/Makefile +15 -0
+		addr = addr & 0xff;
+	}
+#endif
+	return at91_xfer(chip, addr, alen, buffer, len, 1);
+}
+
+int
+i2c_write(unsigned char chip, unsigned int addr, int alen,
+	  unsigned char *buffer, int len)
+{
+#ifdef CONFIG_SYS_I2C_EEPROM_ADDR_OVERFLOW
+	int i;
+	unsigned char *buf;
+
+	/* we only allow one address byte */

drivers/i2c/Makefile

Quoted 10 lines
drivers/i2c/Makefile +10 -0
+	if (alen > 1)
+		return 1;
+	/* XXX assume an ATMEL AT24C16 */
+	if (alen == 1) {
+		buf = buffer;
+		/* do single byte writes */
+		for (i = 0; i < len; i++) {
+#if 0 /* EEPROM code already sets this correctly */
+			chip |= (addr >> 8) & 0xff;
+#endif

here too, please remove dead code.

Quoted 7 lines
drivers/i2c/Makefile +6 -0
+			addr = addr & 0xff;
+			if (at91_xfer(chip, addr, alen, buf++, 1, 0))
+				return 1;
+			addr++;
+		}
+		return 0;

[...]

Quoted 28 lines
include/asm-arm/arch-at91/at91_twi.h new file +22 -0
new file mode 100644
index 0000000..bb2880f
@@ -0,0 +1,68 @@
+/*
+ * arch/arm/mach-at91/include/mach/at91_twi.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Two-wire Interface (TWI) registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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.
+ */
+
+#ifndef AT91_TWI_H
+#define AT91_TWI_H
+
+#define	AT91_TWI_CR		0x00		/* Control Register */
+#define		AT91_TWI_START		(1 <<  0)	/* Send a Start Condition */
+#define		AT91_TWI_STOP		(1 <<  1)	/* Send a Stop Condition */
+#define		AT91_TWI_MSEN		(1 <<  2)	/* Master Transfer Enable */
Quoted 9 lines

include/asm-arm/arch-at91/at91_twi.h line 26

Quoted 5 lines
include/asm-arm/arch-at91/at91_twi.h new file +4 -0
+#define		AT91_TWI_MSDIS		(1 <<  3)	/* Master Transfer Disable */
+#define		AT91_TWI_SVEN		(1 <<  4)	/* Slave Transfer Enable [SAM9260 only] */
+#define		AT91_TWI_SVDIS		(1 <<  5)	/* Slave Transfer Disable [SAM9260 only] */
+#define		AT91_TWI_SWRST		(1 <<  7)	/* Software Reset */

^^^^^^^^^^^^^^^
doule tabs breaks line length (this affects for the
whole file)

I'll prefer to keep it as it because it's an import from Linux

Best Regards,
J.

#17 lore raw

PATCH 12/13 at91: add hardware i2c drivers

Hello Jean-Christophe,

Quoted 45 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 36 lines · Heiko Schocher

Hello Jean,

Quoted 24 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 cpu/arm926ejs/at91/Makefile                        |    6 +
 .../arm926ejs/at91/at91cap9_i2c.c                  |   31 ++--
 .../arm926ejs/at91/at91sam9260_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9261_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9263_i2c.c               |   31 ++--
 .../clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c   |   37 ++--
 drivers/i2c/Makefile                               |    1 +
 drivers/i2c/atmel_i2c.c                            |  234 ++++++++++++++++++++
 include/asm-arm/arch-at91/at91_common.h            |    2 +
 include/asm-arm/arch-at91/at91_twi.h               |   68 ++++++
 include/asm-arm/arch-at91/clk.h                    |    4 +
 include/asm-arm/arch-at91/hardware.h               |    5 +
 12 files changed, 405 insertions(+), 76 deletions(-)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91cap9_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9260_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9261_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9263_i2c.c (61%)
 copy include/asm-arm/arch-at91/clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c (52%)
 create mode 100644 drivers/i2c/atmel_i2c.c
 create mode 100644 include/asm-arm/arch-at91/at91_twi.h

[...]

Quoted 8 lines
drivers/i2c/Makefile +0 -0
index 9c74657..27a5251 100644
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libi2c.a
 
Quoted 8 lines

drivers/i2c/Makefile include $(TOPDIR)/config.mk · line 31

Quoted 5 lines
drivers/i2c/Makefile +1 -0
+COBJS-$(CONFIG_I2C_ATMEL) += atmel_i2c.o
 COBJS-$(CONFIG_BFIN_TWI_I2C) += bfin-twi_i2c.o
 COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o

Independent from your patch, I think we need here a common rule. Either we name in future this define "CONFIG_I2C_XXX" or "CONFIG_XXX_I2C. I vote for using "CONFIG_I2C_XXX"

Quoted 2 lines

it's plan to clean up the driver CONFIG_ just before send the Kconfig patch series

Ah, ok, thanks.

Quoted 8 lines
Quoted 7 lines

drivers/i2c/Makefile

Quoted 6 lines

+ *

drivers/i2c/Makefile +4 -0
+*/
+#include <common.h>
+
+#ifdef CONFIG_HARD_I2C

Why not "#if defined(CONFIG_I2C_ATMEL)" as in the Makefile?

until the Kconfig I'll prefer to keep the CONFIG_HARD_I2C

ok.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
drivers/i2c/Makefile +3 -0
+
+#include <i2c.h>
+#include <asm/io.h>

[...]

Quoted 3 lines
drivers/i2c/Makefile +3 -0
+	if (alen > 1)
+		return 1;
+	/* XXX assume an ATMEL AT24C16 */

[...]

Quoted 37 lines
Quoted 28 lines
Quoted 28 lines
include/asm-arm/arch-at91/at91_twi.h new file +22 -0
new file mode 100644
index 0000000..bb2880f
@@ -0,0 +1,68 @@
+/*
+ * arch/arm/mach-at91/include/mach/at91_twi.h
+ *
+ * Copyright (C) 2005 Ivan Kokshaysky
+ * Copyright (C) SAN People
+ *
+ * Two-wire Interface (TWI) registers.
+ * Based on AT91RM9200 datasheet revision E.
+ *
+ * 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.
+ */
+
+#ifndef AT91_TWI_H
+#define AT91_TWI_H
+
+#define	AT91_TWI_CR		0x00		/* Control Register */
+#define		AT91_TWI_START		(1 <<  0)	/* Send a Start Condition */
+#define		AT91_TWI_STOP		(1 <<  1)	/* Send a Stop Condition */
+#define		AT91_TWI_MSEN		(1 <<  2)	/* Master Transfer Enable */
Quoted 9 lines

include/asm-arm/arch-at91/at91_twi.h line 26

Quoted 5 lines
include/asm-arm/arch-at91/at91_twi.h new file +4 -0
+#define		AT91_TWI_MSDIS		(1 <<  3)	/* Master Transfer Disable */
+#define		AT91_TWI_SVEN		(1 <<  4)	/* Slave Transfer Enable [SAM9260 only] */
+#define		AT91_TWI_SVDIS		(1 <<  5)	/* Slave Transfer Disable [SAM9260 only] */
+#define		AT91_TWI_SWRST		(1 <<  7)	/* Software Reset */

^^^^^^^^^^^^^^^
doule tabs breaks line length (this affects for the
whole file)

Quoted 1 line

I'll prefer to keep it as it because it's an import from Linux

Hmm.. maybe this should be fixed in Linux too.

bye
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#18 lore raw

PATCH 12/13 at91: add hardware i2c drivers

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines

include/asm-arm/arch-at91/at91_twi.h line 26

Quoted 12 lines
include/asm-arm/arch-at91/at91_twi.h new file +11 -0
+#ifndef AT91_TWI_H
+#define AT91_TWI_H
+
+#define	AT91_TWI_CR		0x00		/* Control Register */
+#define		AT91_TWI_START		(1 <<  0)	/* Send a Start Condition */
+#define		AT91_TWI_STOP		(1 <<  1)	/* Send a Stop Condition */
+#define		AT91_TWI_MSEN		(1 <<  2)	/* Master Transfer Enable */
+#define		AT91_TWI_MSDIS		(1 <<  3)	/* Master Transfer Disable */
+#define		AT91_TWI_SVEN		(1 <<  4)	/* Slave Transfer Enable [SAM9260 only] */
+#define		AT91_TWI_SVDIS		(1 <<  5)	/* Slave Transfer Disable [SAM9260 only] */
+#define		AT91_TWI_SWRST		(1 <<  7)	/* Software Reset */

^^^^^^^^^^^^^^^
doule tabs breaks line length (this affects for the
whole file)

Quoted 3 lines
Quoted 1 line

I'll prefer to keep it as it because it's an import from Linux

Hmm.. maybe this should be fixed in Linux too.

IMHO no because the double tab was use to align but field of the register

Best Regards,
J.

#19 lore raw

PATCH 12/13 at91: add hardware i2c drivers

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Hmm.. maybe this should be fixed in Linux too.

IMHO no because the double tab was use to align but field of the register

It doesn't matter what it's being used for when it causes too long lines.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Punishment becomes ineffective after a certain point. Men become  in-
sensitive.
	-- Eneg, "Patterns of Force", stardate 2534.7
#20 lore raw

PATCH 12/13 at91: add hardware i2c drivers

Quoted 9 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 2 lines

Hmm.. maybe this should be fixed in Linux too.

IMHO no because the double tab was use to align but field of the register

It doesn't matter what it's being used for when it causes too long lines.

but it clearly an import from linux and I do want to be sync so I'll prefer to not modify it to simplify the update and tacking

I'll send an e-mail to Andrew Victor to known if he is ok to split

Best Regards,
J.

#21 lore raw

PATCH 12/13 at91: add hardware i2c drivers

In reply to Heiko Schocher

Dear Heiko Schocher,

Quoted 1 line · In message <[email protected]> you wrote:

...

Quoted 3 lines

Independent from your patch, I think we need here a common rule. Either we name in future this define "CONFIG_I2C_XXX" or "CONFIG_XXX_I2C. I vote for using "CONFIG_I2C_XXX"

Me too.

...

Quoted 3 lines
Quoted 1 line

+#ifdef CONFIG_HARD_I2C

Why not "#if defined(CONFIG_I2C_ATMEL)" as in the Makefile?

Excellent question.

Quoted 6 lines

drivers/i2c/atmel_i2c.c line 154

Quoted 4 lines
drivers/i2c/atmel_i2c.c new file +3 -0
+#if 0 /* EEPROM code already sets this correctly */
+		chip |= (addr >> 8) & 0xff;
+#endif

please remove dead code.

Agreed.

Quoted 5 lines

drivers/i2c/atmel_i2c.c line 154

Quoted 3 lines
drivers/i2c/atmel_i2c.c new file +3 -0
+#if 0 /* EEPROM code already sets this correctly */
+			chip |= (addr >> 8) & 0xff;
+#endif

here too, please remove dead code.

Ditto.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Anyone can count the seeds in an apple.
No one can count the apples in a seed.
#22 lore raw

PATCH 12/13 at91: add hardware i2c drivers

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe,

Quoted 14 lines · On Friday 27 March 2009 23:30 you wrote:
---
 cpu/arm926ejs/at91/Makefile                        |    6 +
 .../arm926ejs/at91/at91cap9_i2c.c                  |   31 ++--
 .../arm926ejs/at91/at91sam9260_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9261_i2c.c               |   31 ++--
 .../arm926ejs/at91/at91sam9263_i2c.c               |   31 ++--
 .../clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c   |   37 ++--
 drivers/i2c/Makefile                               |    1 +
 drivers/i2c/atmel_i2c.c                            |  234 ++++++++++++++++++++
 include/asm-arm/arch-at91/at91_common.h            |    2 +
 include/asm-arm/arch-at91/at91_twi.h               |   68 ++++++
 include/asm-arm/arch-at91/clk.h                    |    4 +
 include/asm-arm/arch-at91/hardware.h               |    5 +
Quoted 9 lines
 12 files changed, 405 insertions(+), 76 deletions(-)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91cap9_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9260_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9261_i2c.c (61%)
 copy include/asm-arm/arch-at91/at91_common.h => cpu/arm926ejs/at91/at91sam9263_i2c.c (61%)
 copy include/asm-arm/arch-at91/clk.h => cpu/arm926ejs/at91/at91sam9rl_i2c.c (52%)
 create mode 100644 drivers/i2c/atmel_i2c.c
 create mode 100644 include/asm-arm/arch-at91/at91_twi.h

...

Do you aim to commit a new clean patch for this issue? Hard I2C support would be a really nice feature!

Best regards,
Daniel Gorsulowski

#23 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to Jean-Christophe PLAGNIOL-VILLARD

Hello,

Quoted 3 lines

?drivers/usb/Makefile ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ?1 + ?.../at91/usb.c => drivers/usb/atmel_usb.c ? ? ? ? ?| ? ?0 ?rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c (100%)

Same here, this is architecture specific code, why move it to generic code?

Remy

#24 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Quoted 7 lines · Remy Bohmer

Hello,

Quoted 3 lines

?drivers/usb/Makefile ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ?1 + ?.../at91/usb.c => drivers/usb/atmel_usb.c ? ? ? ? ?| ? ?0 ?rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c (100%)

Same here, this is architecture specific code, why move it to generic code?

it's the at91 usb drivers and we need to have it in the driver/usb and it's not at91/arm926 specific but it's also shared with the at91rm9200

so I move to drivers usb

please note that the RM9200 will be move to the at91 API next release

Best Regards,
J.

#25 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 6 lines
Quoted 5 lines

?drivers/usb/Makefile ? ? ? ? ? ? ? ? ? ? ? ?> ? ? ? | ? ?1 + ?.../at91/usb.c => drivers/usb/atmel_usb.c ? ? ? ? ?| ?> ?0 ?rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c (100%)

Same here, this is architecture specific code, why move it to generic cod> e?

it's the at91 usb drivers and we need to have it in the driver/usb

Why do we need to have it in the driver/usb ?

Please explain in detail.

Quoted 5 lines

and it's not at91/arm926 specific but it's also shared with the at91rm9200

so I move to drivers usb

please note that the RM9200 will be move to the at91 API next release

So. Will it. Really? Who discussed this, and where, and when? Please explain in detail.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Weekends were made for programming.                 - Karl Lehenbauer
#26 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Quoted 15 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 6 lines
Quoted 5 lines

?drivers/usb/Makefile ? ? ? ? ? ? ? ? ? ? ? ?> ? ? ? | ? ?1 + ?.../at91/usb.c => drivers/usb/atmel_usb.c ? ? ? ? ?| ?> ?0 ?rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c (100%)

Same here, this is architecture specific code, why move it to generic cod> e?

it's the at91 usb drivers and we need to have it in the driver/usb

Why do we need to have it in the driver/usb ?

Please explain in detail.

Quoted 8 lines
Quoted 5 lines

and it's not at91/arm926 specific but it's also shared with the at91rm9200

so I move to drivers usb

please note that the RM9200 will be move to the at91 API next release

So. Will it. Really? Who discussed this, and where, and when? Please explain in detail.

as I said the usb drivers, spi, serial are shared between at91sam9, rm9200 and some with avr32
so do need to avoid copy and paste to each cpu specialy when it's drivers or IP init not specific to a SOC

The RM9200 is in preparation and will be finished for the next merge window so no patch has been yes published until it's finished

Best Regards,
J.

#27 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to Wolfgang Denk
Quoted 5 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 4 lines
Quoted 3 lines

?drivers/usb/Makefile ? ? ? ? ? ? ? ? ? ? ? ?> ? ? ? | ? ?1 + ?.../at91/usb.c => drivers/usb/atmel_usb.c ? ? ? ? ?| ?> ?0 ?rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c (100%)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Same here, this is architecture specific code, why move it to generic cod> e?

it's the at91 usb drivers and we need to have it in the driver/usb

Why do we need to have it in the driver/usb ?

Please explain in detail.

From what I remember we all agreed to move the device drivers (e.g. ethernet, NAND, USB, serial etc) from the architecture/board (cpu/... board/...) to the drivers directories at some time.

Speaking for PPC4xx, the 4xx ethernet driver has recently been moved from cpu/ppc4xx to drivers/net. And I'm planning to move the 4xx NAND driver (and others) soon too.

So if this atmel_usb.c driver isn't just platform USB init code, but a real USB driver, then I'm voting to move it to drivers/usb as well.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#28 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Hello Stefan,

Quoted 10 lines

From what I remember we all agreed to move the device drivers (e.g. ethernet, NAND, USB, serial etc) from the architecture/board (cpu/... board/...) to the drivers directories at some time.

Speaking for PPC4xx, the 4xx ethernet driver has recently been moved from cpu/ppc4xx to drivers/net. And I'm planning to move the 4xx NAND driver (and others) soon too.

So if this atmel_usb.c driver isn't just platform USB init code, but a real USB driver, then I'm voting to move it to drivers/usb as well.

And that is exactly the issue here. The discussion is about moving 'platform USB init code' to generic driver code.
I would have no problems with moving real USB drivers to the generic driver section, if they are cleaned from board specific code, of course.

Kind Regards,

Remy

#29 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Quoted 10 lines · Remy Bohmer

Hello Stefan,

Quoted 8 lines

From what I remember we all agreed to move the device drivers (e.g. ethernet, NAND, USB, serial etc) from the architecture/board (cpu/... board/...) to the drivers directories at some time.

Speaking for PPC4xx, the 4xx ethernet driver has recently been moved from cpu/ppc4xx to drivers/net. And I'm planning to move the 4xx NAND driver (and others) soon too.

Quoted 8 lines
Quoted 2 lines

So if this atmel_usb.c driver isn't just platform USB init code, but a real USB driver, then I'm voting to move it to drivers/usb as well.

And that is exactly the issue here. The discussion is about moving 'platform USB init code' to generic driver code.
I would have no problems with moving real USB drivers to the generic driver section, if they are cleaned from board specific code, of course.

in our case it's not a cpu specify init but an IP init which is share to multiple soc for multiple arch

Best Regards,
J.

#30 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Hello Jean-Christophe,

Quoted 7 lines
Quoted 5 lines

And that is exactly the issue here. The discussion is about moving 'platform USB init code' to generic driver code.
I would have no problems with moving real USB drivers to the generic driver section, if they are cleaned from board specific code, of course.

in our case it's not a cpu specify init but an IP init which is share to multiple soc for multiple arch

IMHO, that still does not justify it to make it part of the generic drivers. And I already mentioned yesterday, that I agree that it does not really belong in the cpu section as well.
We should not pollute one area by cleaning another area.

So, we seem to be lacking a SoC/board specific section, like the linux kernel handles it.
Maybe we have to work on that?

Kind Regards,

Remy

#31 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Quoted 10 lines · Remy Bohmer

Hello Jean-Christophe,

Quoted 7 lines
Quoted 5 lines

And that is exactly the issue here. The discussion is about moving 'platform USB init code' to generic driver code.
I would have no problems with moving real USB drivers to the generic driver section, if they are cleaned from board specific code, of course.

in our case it's not a cpu specify init but an IP init which is share to multiple soc for multiple arch

Quoted 8 lines

IMHO, that still does not justify it to make it part of the generic drivers. And I already mentioned yesterday, that I agree that it does not really belong in the cpu section as well.
We should not pollute one area by cleaning another area.

So, we seem to be lacking a SoC/board specific section, like the linux kernel handles it.
Maybe we have to work on that?

actualy it's clearly not possible and I'll not ACK any patch that dupplicate code in the boards specialy after clean up the duplicate hardware init.

Actually the best place is the drivers/usb/

Best Regards,
J.

#32 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 2 lines · In message <[email protected]> you wrote:

Actually the best place is the drivers/usb/

I agree with Remy: "We should not pollute one area by cleaning another area."

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
About the use of language: it is impossible to sharpen a pencil  with
a  blunt  ax.  It is equally vain to try to do it with ten blunt axes
instead.                                           -- Edsger Dijkstra
#33 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to Remy Bohmer
Quoted 10 lines · Remy Bohmer

Hello Jean-Christophe,

Quoted 7 lines
Quoted 5 lines

And that is exactly the issue here. The discussion is about moving 'platform USB init code' to generic driver code.
I would have no problems with moving real USB drivers to the generic driver section, if they are cleaned from board specific code, of course.

in our case it's not a cpu specify init but an IP init which is share to multiple soc for multiple arch

Quoted 7 lines

IMHO, that still does not justify it to make it part of the generic drivers. And I already mentioned yesterday, that I agree that it does not really belong in the cpu section as well.
We should not pollute one area by cleaning another area.

So, we seem to be lacking a SoC/board specific section, like the linux kernel handles it.

btw in linux the similar usb code is here
drivers/usb/host/ohci-at91.c

Best Regards,
J.

#34 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Hi,

Quoted 25 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 12 lines · Remy Bohmer

Hello Jean-Christophe,

Quoted 9 lines
Quoted 6 lines

And that is exactly the issue here. The discussion is about moving 'platform USB init code' to generic driver code.
I would have no problems with moving real USB drivers to the generic driver section, if they are cleaned from board specific code, of course.

in our case it's not a cpu specify init but an IP init which is share to multiple soc for multiple arch

Quoted 8 lines

IMHO, that still does not justify it to make it part of the generic drivers. And I already mentioned yesterday, that I agree that it does not really belong in the cpu section as well.
We should not pollute one area by cleaning another area.

So, we seem to be lacking a SoC/board specific section, like the linux kernel handles it.

btw in linux the similar usb code is here
drivers/usb/host/ohci-at91.c

Quoted 8 lines

Best Regards,
J.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

It is just a glue code in linux. Maybe it will be simple if you create a core direcory
and a host directory under the usb. An move the specific part in the host.

Michael

#35 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Quoted 3 lines · Michael Trimarchi

It is just a glue code in linux. Maybe it will be simple if you create a core direcory
and a host directory under the usb. An move the specific part in the host.

Yes, I like this idea. This gets us closer to the Linux directory structure.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#36 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Quoted 6 lines · Stefan Roese
Quoted 3 lines · Michael Trimarchi

It is just a glue code in linux. Maybe it will be simple if you create a core direcory
and a host directory under the usb. An move the specific part in the host.

Yes, I like this idea. This gets us closer to the Linux directory structure.

I like too
so at the same time we could do the same for the device

Best Regards,
J.

#37 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Quoted 7 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 6 lines · Stefan Roese
Quoted 4 lines · Michael Trimarchi

It is just a glue code in linux. Maybe it will be simple if you create a core direcory
and a host directory under the usb. An move the specific part in the host.

Quoted 5 lines
Quoted 2 lines

Yes, I like this idea. This gets us closer to the Linux directory structure.

I like too
so at the same time we could do the same for the device

Exactly.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#38 lore raw

RFC PATCH 1/1 drivers/usb: regorganisation

---
better description will be wrote for the final patch

Best Regards,
J.

 Makefile                                     |    4 +++-
 drivers/usb/{ => core}/Makefile              |   22 +---------------------
 drivers/usb/{ => core}/usb_ehci_core.c       |    2 +-
 drivers/usb/{ => core}/usb_ohci.c            |    2 +-
 drivers/usb/{ => core}/usbdcore.c            |    2 +-
 drivers/usb/{ => gadget}/Makefile            |   19 +------------------
 drivers/usb/{ => gadget}/usbdcore_ep0.c      |    2 +-
 drivers/usb/{ => gadget}/usbdcore_mpc8xx.c   |    4 ++--
 drivers/usb/{ => gadget}/usbdcore_omap1510.c |    4 ++--
 drivers/usb/{ => host}/Makefile              |   15 +--------------
 drivers/usb/{ => host}/davinci_usb.c         |    0
 drivers/usb/{ => host}/davinci_usb.h         |    0
 drivers/usb/{ => host}/isp116x-hcd.c         |    0
 drivers/usb/{ => host}/isp116x.h             |    0
 drivers/usb/{ => host}/musb_core.c           |    0
 drivers/usb/{ => host}/musb_core.h           |    0
 drivers/usb/{ => host}/musb_hcd.c            |    0
 drivers/usb/{ => host}/musb_hcd.h            |    0
 drivers/usb/{ => host}/r8a66597-hcd.c        |    0
 drivers/usb/{ => host}/r8a66597.h            |    0
 drivers/usb/{ => host}/sl811.h               |    0
 drivers/usb/{ => host}/sl811_usb.c           |    2 +-
 drivers/usb/{ => host}/usb_ehci_fsl.c        |    5 ++---
 drivers/usb/{ => host}/usb_ehci_fsl.h        |    0
 drivers/usb/{ => host}/usb_ehci_ixp.c        |    4 ++--
 drivers/usb/{ => host}/usb_ehci_pci.c        |    4 ++--
 drivers/usb/{ => host}/usb_ehci_vct.c        |    5 ++---
 {drivers/usb => include}/usb_ehci.h          |    0
 {drivers/usb => include}/usb_ehci_core.h     |    0
 {drivers/usb => include}/usb_ohci.h          |    0
 30 files changed, 23 insertions(+), 73 deletions(-)
 copy drivers/usb/{ => core}/Makefile (67%)
 rename drivers/usb/{ => core}/usb_ehci_core.c (99%)
 rename drivers/usb/{ => core}/usb_ohci.c (99%)
 rename drivers/usb/{ => core}/usbdcore.c (99%)
 copy drivers/usb/{ => gadget}/Makefile (71%)
 rename drivers/usb/{ => gadget}/usbdcore_ep0.c (99%)
 rename drivers/usb/{ => gadget}/usbdcore_mpc8xx.c (99%)
 rename drivers/usb/{ => gadget}/usbdcore_omap1510.c (99%)
 rename drivers/usb/{ => host}/Makefile (82%)
 rename drivers/usb/{ => host}/davinci_usb.c (100%)
 rename drivers/usb/{ => host}/davinci_usb.h (100%)
 rename drivers/usb/{ => host}/isp116x-hcd.c (100%)
 rename drivers/usb/{ => host}/isp116x.h (100%)
 rename drivers/usb/{ => host}/musb_core.c (100%)
 rename drivers/usb/{ => host}/musb_core.h (100%)
 rename drivers/usb/{ => host}/musb_hcd.c (100%)
 rename drivers/usb/{ => host}/musb_hcd.h (100%)
 rename drivers/usb/{ => host}/r8a66597-hcd.c (100%)
 rename drivers/usb/{ => host}/r8a66597.h (100%)
 rename drivers/usb/{ => host}/sl811.h (100%)
 rename drivers/usb/{ => host}/sl811_usb.c (99%)
 rename drivers/usb/{ => host}/usb_ehci_fsl.c (98%)
 rename drivers/usb/{ => host}/usb_ehci_fsl.h (100%)
 rename drivers/usb/{ => host}/usb_ehci_ixp.c (96%)
 rename drivers/usb/{ => host}/usb_ehci_pci.c (97%)
 rename drivers/usb/{ => host}/usb_ehci_vct.c (96%)
 rename {drivers/usb => include}/usb_ehci.h (100%)
 rename {drivers/usb => include}/usb_ehci_core.h (100%)
 rename {drivers/usb => include}/usb_ohci.h (100%)
Makefile +3 -1
index 1cce381..cad21ac 100644
@@ -262,7 +262,9 @@ TAG_SUBDIRS += cpu/mpc8xxx
 endif
 LIBS += drivers/rtc/librtc.a
 LIBS += drivers/serial/libserial.a
-LIBS += drivers/usb/libusb.a
+LIBS += drivers/usb/core/libusb_core.a
+LIBS += drivers/usb/gadget/libusb_gadget.a
+LIBS += drivers/usb/host/libusb_host.a
 LIBS += drivers/video/libvideo.a
 LIBS += common/libcommon.a
 LIBS += libfdt/libfdt.a
drivers/usb/core/Makefile renamed from drivers/usb/Makefile +1 -21
similarity index 67%
copy from drivers/usb/Makefile
copy to drivers/usb/core/Makefile
index b306a65..249da4b 100644
@@ -23,32 +23,12 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	:= $(obj)libusb.a
+LIB	:= $(obj)libusb_core.a
 
-# core
 COBJS-y += usbdcore.o
 COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
 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_SL811HS) += sl811_usb.o
-COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o
-COBJS-$(CONFIG_USB_EHCI_PCI) += usb_ehci_pci.o
-COBJS-$(CONFIG_USB_EHCI_IXP4XX) += usb_ehci_ixp.o
-COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
-COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
-COBJS-$(CONFIG_USB_EHCI_VCT) += usb_ehci_vct.o
-
-# device
-ifdef CONFIG_USB_DEVICE
-COBJS-y += usbdcore_ep0.o
-COBJS-$(CONFIG_OMAP1510) += usbdcore_omap1510.o
-COBJS-$(CONFIG_OMAP1610) += usbdcore_omap1510.o
-COBJS-$(CONFIG_MPC885_FAMILY) += usbdcore_mpc8xx.o
-endif
-
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
drivers/usb/core/usb_ehci_core.c renamed from drivers/usb/usb_ehci_core.c +1 -1
similarity index 99%
rename from drivers/usb/usb_ehci_core.c
rename to drivers/usb/core/usb_ehci_core.c
index 4dbfb66..081622b 100644
@@ -25,7 +25,7 @@
 #include <usb.h>
 #include <asm/io.h>
 #include <malloc.h>
-#include "usb_ehci.h"
+#include <usb_ehci.h>
 
 int rootdev;
 struct ehci_hccr *hccr;	/* R/O registers, not need for volatile */
drivers/usb/core/usb_ohci.c renamed from drivers/usb/usb_ohci.c +1 -1
similarity index 99%
rename from drivers/usb/usb_ohci.c
rename to drivers/usb/core/usb_ohci.c
index 0bbee0f..464dbe2 100644
@@ -57,7 +57,7 @@
 
 #include <malloc.h>
 #include <usb.h>
-#include "usb_ohci.h"
+#include <usb_ohci.h>
 
 #ifdef CONFIG_AT91RM9200
 #include <asm/arch/hardware.h>	/* needed for AT91_USB_HOST_BASE */
drivers/usb/core/usbdcore.c renamed from drivers/usb/usbdcore.c +1 -1
similarity index 99%
rename from drivers/usb/usbdcore.c
rename to drivers/usb/core/usbdcore.c
index 53ed669..7955096 100644
@@ -30,7 +30,7 @@
  */
 
 #include <malloc.h>
-#include "usbdcore.h"
+#include <usbdcore.h>
 
 #define MAX_INTERFACES 2
 
drivers/usb/gadget/Makefile renamed from drivers/usb/Makefile +1 -18
similarity index 71%
copy from drivers/usb/Makefile
copy to drivers/usb/gadget/Makefile
index b306a65..933eac9 100644
@@ -23,25 +23,8 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	:= $(obj)libusb.a
+LIB	:= $(obj)libusb_gadget.a
 
-# core
-COBJS-y += usbdcore.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
-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_SL811HS) += sl811_usb.o
-COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o
-COBJS-$(CONFIG_USB_EHCI_PCI) += usb_ehci_pci.o
-COBJS-$(CONFIG_USB_EHCI_IXP4XX) += usb_ehci_ixp.o
-COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
-COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
-COBJS-$(CONFIG_USB_EHCI_VCT) += usb_ehci_vct.o
-
-# device
 ifdef CONFIG_USB_DEVICE
 COBJS-y += usbdcore_ep0.o
 COBJS-$(CONFIG_OMAP1510) += usbdcore_omap1510.o
drivers/usb/gadget/usbdcore_ep0.c renamed from drivers/usb/usbdcore_ep0.c +1 -1
similarity index 99%
rename from drivers/usb/usbdcore_ep0.c
rename to drivers/usb/gadget/usbdcore_ep0.c
index f6e017d..a1a117d 100644
@@ -51,7 +51,7 @@
  */
 
 #include <common.h>
-#include "usbdcore.h"
+#include <usbdcore.h>
 
 #if 0
 #define dbg_ep0(lvl,fmt,args...) serial_printf("[%s] %s:%d: "fmt"\n",__FILE__,__FUNCTION__,__LINE__,##args)
drivers/usb/gadget/usbdcore_mpc8xx.c renamed from drivers/usb/usbdcore_mpc8xx.c +2 -2
similarity index 99%
rename from drivers/usb/usbdcore_mpc8xx.c
rename to drivers/usb/gadget/usbdcore_mpc8xx.c
index 0e311ad..e2439cd 100644
@@ -59,9 +59,9 @@
 #include <common.h>
 #include <config.h>
 #include <commproc.h>
-#include "usbdcore.h"
+#include <usbdcore.h>
 #include "usbdcore_mpc8xx.h"
-#include "usbdcore_ep0.h"
+#include <usbdcore_ep0.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/usb/gadget/usbdcore_omap1510.c renamed from drivers/usb/usbdcore_omap1510.c +2 -2
similarity index 99%
rename from drivers/usb/usbdcore_omap1510.c
rename to drivers/usb/gadget/usbdcore_omap1510.c
index 6b7b61b..4fb6cc5 100644
@@ -32,9 +32,9 @@
 #include <i2c.h>
 #endif
 
-#include "usbdcore.h"
+#include <usbdcore.h>
 #include "usbdcore_omap1510.h"
-#include "usbdcore_ep0.h"
+#include <usbdcore_ep0.h>
 
 
 #define UDC_INIT_MDELAY		     80 /* Device settle delay */
drivers/usb/host/Makefile renamed from drivers/usb/Makefile +1 -14
similarity index 82%
rename from drivers/usb/Makefile
rename to drivers/usb/host/Makefile
index b306a65..240bc36 100644
@@ -23,12 +23,7 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	:= $(obj)libusb.a
-
-# core
-COBJS-y += usbdcore.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
-COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
+LIB	:= $(obj)libusb_host.a
 
 # host
 COBJS-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o
@@ -41,14 +36,6 @@ COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
 COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
 COBJS-$(CONFIG_USB_EHCI_VCT) += usb_ehci_vct.o
 
-# device
-ifdef CONFIG_USB_DEVICE
-COBJS-y += usbdcore_ep0.o
-COBJS-$(CONFIG_OMAP1510) += usbdcore_omap1510.o
-COBJS-$(CONFIG_OMAP1610) += usbdcore_omap1510.o
-COBJS-$(CONFIG_MPC885_FAMILY) += usbdcore_mpc8xx.o
-endif
-
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
drivers/usb/host/davinci_usb.c renamed from drivers/usb/davinci_usb.c +0 -0
similarity index 100%
rename from drivers/usb/davinci_usb.c
rename to drivers/usb/host/davinci_usb.c
drivers/usb/host/davinci_usb.h renamed from drivers/usb/davinci_usb.h +0 -0
similarity index 100%
rename from drivers/usb/davinci_usb.h
rename to drivers/usb/host/davinci_usb.h
drivers/usb/host/isp116x-hcd.c renamed from drivers/usb/isp116x-hcd.c +0 -0
similarity index 100%
rename from drivers/usb/isp116x-hcd.c
rename to drivers/usb/host/isp116x-hcd.c
drivers/usb/host/isp116x.h renamed from drivers/usb/isp116x.h +0 -0
similarity index 100%
rename from drivers/usb/isp116x.h
rename to drivers/usb/host/isp116x.h
drivers/usb/host/musb_core.c renamed from drivers/usb/musb_core.c +0 -0
similarity index 100%
rename from drivers/usb/musb_core.c
rename to drivers/usb/host/musb_core.c
drivers/usb/host/musb_core.h renamed from drivers/usb/musb_core.h +0 -0
similarity index 100%
rename from drivers/usb/musb_core.h
rename to drivers/usb/host/musb_core.h
drivers/usb/host/musb_hcd.c renamed from drivers/usb/musb_hcd.c +0 -0
similarity index 100%
rename from drivers/usb/musb_hcd.c
rename to drivers/usb/host/musb_hcd.c
drivers/usb/host/musb_hcd.h renamed from drivers/usb/musb_hcd.h +0 -0
similarity index 100%
rename from drivers/usb/musb_hcd.h
rename to drivers/usb/host/musb_hcd.h
drivers/usb/host/r8a66597-hcd.c renamed from drivers/usb/r8a66597-hcd.c +0 -0
similarity index 100%
rename from drivers/usb/r8a66597-hcd.c
rename to drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/r8a66597.h renamed from drivers/usb/r8a66597.h +0 -0
similarity index 100%
rename from drivers/usb/r8a66597.h
rename to drivers/usb/host/r8a66597.h
drivers/usb/host/sl811.h renamed from drivers/usb/sl811.h +0 -0
similarity index 100%
rename from drivers/usb/sl811.h
rename to drivers/usb/host/sl811.h
drivers/usb/host/sl811_usb.c renamed from drivers/usb/sl811_usb.c +1 -1
similarity index 99%
rename from drivers/usb/sl811_usb.c
rename to drivers/usb/host/sl811_usb.c
index a03e469..82a8b36 100644
@@ -40,7 +40,7 @@
 #include <usb.h>
 #include "sl811.h"
 
-#include "../../board/kup/common/kup.h"
+#include "../../../board/kup/common/kup.h"
 
 #ifdef __PPC__
 # define EIEIO		__asm__ volatile ("eieio")
drivers/usb/host/usb_ehci_fsl.c renamed from drivers/usb/usb_ehci_fsl.c +2 -3
similarity index 98%
rename from drivers/usb/usb_ehci_fsl.c
rename to drivers/usb/host/usb_ehci_fsl.c
index 81d5d21..866a83d 100644
@@ -25,10 +25,9 @@
 #include <mpc83xx.h>
 #include <asm/io.h>
 #include <asm/bitops.h>
-
-#include "usb_ehci.h"
+#include <usb_ehci.h>
 #include "usb_ehci_fsl.h"
-#include "usb_ehci_core.h"
+#include <usb_ehci_core.h>
 
 /*
  * Create the appropriate control structures to manage
drivers/usb/host/usb_ehci_fsl.h renamed from drivers/usb/usb_ehci_fsl.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci_fsl.h
rename to drivers/usb/host/usb_ehci_fsl.h
drivers/usb/host/usb_ehci_ixp.c renamed from drivers/usb/usb_ehci_ixp.c +2 -2
similarity index 96%
rename from drivers/usb/usb_ehci_ixp.c
rename to drivers/usb/host/usb_ehci_ixp.c
index 25c18c1..f6d1d02 100644
@@ -21,8 +21,8 @@
  */
 #include <common.h>
 #include <usb.h>
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+#include <usb_ehci.h>
+#include <usb_ehci_core.h>
 /*
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
drivers/usb/host/usb_ehci_pci.c renamed from drivers/usb/usb_ehci_pci.c +2 -2
similarity index 97%
rename from drivers/usb/usb_ehci_pci.c
rename to drivers/usb/host/usb_ehci_pci.c
index 3e7143c..64ca3df 100644
@@ -21,8 +21,8 @@
 #include <common.h>
 #include <pci.h>
 #include <usb.h>
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+#include <usb_ehci.h>
+#include <usb_ehci_core.h>
 
 #ifdef CONFIG_PCI_EHCI_DEVICE
 static struct pci_device_id ehci_pci_ids[] = {
drivers/usb/host/usb_ehci_vct.c renamed from drivers/usb/usb_ehci_vct.c +2 -3
similarity index 96%
rename from drivers/usb/usb_ehci_vct.c
rename to drivers/usb/host/usb_ehci_vct.c
index 89daaaf..769b4b2 100644
@@ -19,9 +19,8 @@
 
 #include <common.h>
 #include <usb.h>
-
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+#include <usb_ehci.h>
+#include <usb_ehci_core.h>
 
 int vct_ehci_hcd_init(u32 *hccr, u32 *hcor);
 
include/usb_ehci.h renamed from drivers/usb/usb_ehci.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci.h
rename to include/usb_ehci.h
include/usb_ehci_core.h renamed from drivers/usb/usb_ehci_core.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci_core.h
rename to include/usb_ehci_core.h
include/usb_ohci.h renamed from drivers/usb/usb_ohci.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ohci.h
rename to include/usb_ohci.h
Signature · 1 line
1.6.1.3
#39 lore raw

RFC PATCH 1/1 drivers/usb: regorganisation

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 3 lines · In message <[email protected]> you wrote:

---
better description will be wrote for the final patch

Maybe we should then remove some redundancy in the file names, too? Like that:

Quoted 6 lines

Best Regards,

 Makefile                                     |    4 +++-
 drivers/usb/{ => core}/Makefile              |   22 +---------------------
 drivers/usb/{ => core}/usb_ehci_core.c       |    2 +-
 drivers/usb/{ => core}/usb_ohci.c            |    2 +-

usb_ehci_core.c => ehci_core.c ?
usb_ohci.c => ohci.c ?

Quoted 5 lines
 drivers/usb/{ => core}/usbdcore.c            |    2 +-
 drivers/usb/{ => gadget}/Makefile            |   19 +------------------
 drivers/usb/{ => gadget}/usbdcore_ep0.c      |    2 +-
 drivers/usb/{ => gadget}/usbdcore_mpc8xx.c   |    4 ++--
 drivers/usb/{ => gadget}/usbdcore_omap1510.c |    4 ++--

usbdcore => dcore ?

Quoted 8 lines
 drivers/usb/{ => host}/usb_ehci_fsl.c        |    5 ++---
 drivers/usb/{ => host}/usb_ehci_fsl.h        |    0
 drivers/usb/{ => host}/usb_ehci_ixp.c        |    4 ++--
 drivers/usb/{ => host}/usb_ehci_pci.c        |    4 ++--
 drivers/usb/{ => host}/usb_ehci_vct.c        |    5 ++---
 {drivers/usb => include}/usb_ehci.h          |    0
 {drivers/usb => include}/usb_ehci_core.h     |    0
 {drivers/usb => include}/usb_ohci.h          |    0

usb_[eo]hci => [eo]hci ?

etc.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"More software projects have gone awry for lack of calendar time than
for all other causes combined."
                         - Fred Brooks, Jr., _The Mythical Man Month_
#40 lore raw

RFC PATCH 1/1 drivers/usb: regorganisation

Quoted 12 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 3 lines · In message <[email protected]> you wrote:

---
better description will be wrote for the final patch

Maybe we should then remove some redundancy in the file names, too? Like that:

Quoted 2 lines

Best Regards,

Quoted 7 lines
Quoted 4 lines
 Makefile                                     |    4 +++-
 drivers/usb/{ => core}/Makefile              |   22 +---------------------
 drivers/usb/{ => core}/usb_ehci_core.c       |    2 +-
 drivers/usb/{ => core}/usb_ohci.c            |    2 +-

usb_ehci_core.c => ehci_core.c ?
usb_ohci.c => ohci.c ?

is this case ehci.c could be better

Quoted 8 lines
Quoted 6 lines
 drivers/usb/{ => core}/usbdcore.c            |    2 +-
 drivers/usb/{ => gadget}/Makefile            |   19 +------------------
 drivers/usb/{ => gadget}/usbdcore_ep0.c      |    2 +-
 drivers/usb/{ => gadget}/usbdcore_mpc8xx.c   |    4 ++--
 drivers/usb/{ => gadget}/usbdcore_omap1510.c |    4 ++--

usbdcore => dcore ?

device or udc as in most of the linux file name

Quoted 10 lines
Quoted 9 lines
 drivers/usb/{ => host}/usb_ehci_fsl.c        |    5 ++---
 drivers/usb/{ => host}/usb_ehci_fsl.h        |    0
 drivers/usb/{ => host}/usb_ehci_ixp.c        |    4 ++--
 drivers/usb/{ => host}/usb_ehci_pci.c        |    4 ++--
 drivers/usb/{ => host}/usb_ehci_vct.c        |    5 ++---
 {drivers/usb => include}/usb_ehci.h          |    0
 {drivers/usb => include}/usb_ehci_core.h     |    0
 {drivers/usb => include}/usb_ohci.h          |    0
Quoted 2 lines

usb_[eo]hci => [eo]hci ?

Remy what do you prefer?

Best Regards,
J.

#41 lore raw

RFC PATCH 1/1 drivers/usb: regorganisation

Hello Jean-Christophe,

Quoted 3 lines
Quoted 2 lines

usb_[eo]hci => [eo]hci ?

Remy what do you prefer?

I think this structure is a whole lot better then dumping everything in a flat directory tree.
And I also prefer to follow the Linux kernel structure, thus without usb_ prefixes.

e.g.: drivers/usb/host/ochi.c or drivers/usb/host/echi.c

Kind Regards,

Remy

#42 lore raw

RFC PATCH v2 1/1 drivers/usb: regorganisation

move to linux usb driver organisation

---
Remy is this one ok for you?

I've try to respect the usb driver linux organistation at maximum

Best Regards,
J.

 Makefile                                           |    4 +-
 drivers/serial/usbtty.c                            |    2 +-
 drivers/serial/usbtty.h                            |    6 +-
 drivers/usb/{ => gadget}/Makefile                  |   29 +++----------
 drivers/usb/{usbdcore.c => gadget/core.c}          |    2 +-
 drivers/usb/{usbdcore_ep0.c => gadget/ep0.c}       |    2 +-
 include/usbdcore_ep0.h => drivers/usb/gadget/ep0.h |    0
 .../usb/{usbdcore_mpc8xx.c => gadget/mpc8xx_udc.c} |    9 ++--
 .../{usbdcore_omap1510.c => gadget/omap1510_udc.c} |    6 +-
 drivers/usb/{ => host}/Makefile                    |   35 +++++----------
 drivers/usb/{usb_ehci_core.h => host/ehci-core.h}  |    0
 drivers/usb/{usb_ehci_fsl.c => host/ehci-fsl.c}    |    6 +-
 drivers/usb/{usb_ehci_fsl.h => host/ehci-fsl.h}    |    0
 drivers/usb/{usb_ehci_core.c => host/ehci-hcd.c}   |    3 +-
 drivers/usb/{usb_ehci_ixp.c => host/ehci-ixp4xx.c} |    5 +-
 drivers/usb/{usb_ehci_pci.c => host/ehci-pci.c}    |    5 +-
 drivers/usb/{usb_ehci_vct.c => host/ehci-vct.c}    |    4 +-
 drivers/usb/{usb_ehci.h => host/ehci.h}            |    0
 drivers/usb/{ => host}/isp116x-hcd.c               |    0
 drivers/usb/{ => host}/isp116x.h                   |    0
 drivers/usb/{usb_ohci.c => host/ohci-hcd.c}        |    3 +-
 drivers/usb/{usb_ohci.h => host/ohci.h}            |    0
 drivers/usb/{ => host}/r8a66597-hcd.c              |    0
 drivers/usb/{ => host}/r8a66597.h                  |    0
 drivers/usb/{s3c64xx_usb.c => host/s3c64xx-hcd.c}  |    0
 drivers/usb/{sl811_usb.c => host/sl811-hcd.c}      |    2 +-
 drivers/usb/{ => host}/sl811.h                     |    0
 drivers/usb/musb/Makefile                          |   47 ++++++++++++++++++++
 drivers/usb/{davinci_usb.c => musb/davinci.c}      |    2 +-
 drivers/usb/{davinci_usb.h => musb/davinci.h}      |    0
 drivers/usb/{ => musb}/musb_core.c                 |    0
 drivers/usb/{ => musb}/musb_core.h                 |    0
 drivers/usb/{ => musb}/musb_hcd.c                  |    0
 drivers/usb/{ => musb}/musb_hcd.h                  |    0
 include/{usbdcore_mpc8xx.h => usb/mpc8xx_udc.h}    |    0
 .../{usbdcore_omap1510.h => usb/omap1510_udc.h}    |    0
 include/{usbdcore.h => usbdevice.h}                |    0
 37 files changed, 99 insertions(+), 73 deletions(-)
 copy drivers/usb/{ => gadget}/Makefile (61%)
 rename drivers/usb/{usbdcore.c => gadget/core.c} (99%)
 rename drivers/usb/{usbdcore_ep0.c => gadget/ep0.c} (99%)
 rename include/usbdcore_ep0.h => drivers/usb/gadget/ep0.h (100%)
 rename drivers/usb/{usbdcore_mpc8xx.c => gadget/mpc8xx_udc.c} (99%)
 rename drivers/usb/{usbdcore_omap1510.c => gadget/omap1510_udc.c} (99%)
 rename drivers/usb/{ => host}/Makefile (65%)
 rename drivers/usb/{usb_ehci_core.h => host/ehci-core.h} (100%)
 rename drivers/usb/{usb_ehci_fsl.c => host/ehci-fsl.c} (97%)
 rename drivers/usb/{usb_ehci_fsl.h => host/ehci-fsl.h} (100%)
 rename drivers/usb/{usb_ehci_core.c => host/ehci-hcd.c} (99%)
 rename drivers/usb/{usb_ehci_ixp.c => host/ehci-ixp4xx.c} (96%)
 rename drivers/usb/{usb_ehci_pci.c => host/ehci-pci.c} (97%)
 rename drivers/usb/{usb_ehci_vct.c => host/ehci-vct.c} (96%)
 rename drivers/usb/{usb_ehci.h => host/ehci.h} (100%)
 rename drivers/usb/{ => host}/isp116x-hcd.c (100%)
 rename drivers/usb/{ => host}/isp116x.h (100%)
 rename drivers/usb/{usb_ohci.c => host/ohci-hcd.c} (99%)
 rename drivers/usb/{usb_ohci.h => host/ohci.h} (100%)
 rename drivers/usb/{ => host}/r8a66597-hcd.c (100%)
 rename drivers/usb/{ => host}/r8a66597.h (100%)
 rename drivers/usb/{s3c64xx_usb.c => host/s3c64xx-hcd.c} (100%)
 rename drivers/usb/{sl811_usb.c => host/sl811-hcd.c} (99%)
 rename drivers/usb/{ => host}/sl811.h (100%)
 create mode 100644 drivers/usb/musb/Makefile
 rename drivers/usb/{davinci_usb.c => musb/davinci.c} (99%)
 rename drivers/usb/{davinci_usb.h => musb/davinci.h} (100%)
 rename drivers/usb/{ => musb}/musb_core.c (100%)
 rename drivers/usb/{ => musb}/musb_core.h (100%)
 rename drivers/usb/{ => musb}/musb_hcd.c (100%)
 rename drivers/usb/{ => musb}/musb_hcd.h (100%)
 rename include/{usbdcore_mpc8xx.h => usb/mpc8xx_udc.h} (100%)
 rename include/{usbdcore_omap1510.h => usb/omap1510_udc.h} (100%)
 rename include/{usbdcore.h => usbdevice.h} (100%)
Makefile +3 -1
index f857641..565df93 100644
@@ -263,7 +263,9 @@ endif
 LIBS += drivers/rtc/librtc.a
 LIBS += drivers/serial/libserial.a
 LIBS += drivers/twserial/libtws.a
-LIBS += drivers/usb/libusb.a
+LIBS += drivers/usb/gadget/libusb_gadget.a
+LIBS += drivers/usb/musb/libusb_musb.a
+LIBS += drivers/usb/host/libusb_host.a
 LIBS += drivers/video/libvideo.a
 LIBS += common/libcommon.a
 LIBS += libfdt/libfdt.a
drivers/serial/usbtty.c +1 -1
index d8b1387..71f0e5b 100644
@@ -94,7 +94,7 @@ static char serial_number[16];
  * Descriptors, Strings, Local variables.
  */
 
-/* defined and used by usbdcore_ep0.c */
+/* defined and used by ep0.c */
 extern struct usb_string_descriptor **usb_strings;
 
 /* Indicies, References */
drivers/serial/usbtty.h +3 -3
index ecefde5..77db972 100644
@@ -24,11 +24,11 @@
 #ifndef __USB_TTY_H__
 #define __USB_TTY_H__
 
-#include <usbdcore.h>
+#include <usbdevice.h>
 #if defined(CONFIG_PPC)
-#include <usbdcore_mpc8xx.h>
+#include <usb/mpc8xx_udc.h>
 #elif defined(CONFIG_ARM)
-#include <usbdcore_omap1510.h>
+#include <usb/omap1510_udc.h>
 #endif
 
 #include <version_autogenerated.h>
drivers/usb/gadget/Makefile renamed from drivers/usb/Makefile +6 -23
similarity index 61%
copy from drivers/usb/Makefile
copy to drivers/usb/gadget/Makefile
index 7ddb72a..251724f 100644
@@ -23,31 +23,14 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	:= $(obj)libusb.a
+LIB	:= $(obj)libusb_gadget.a
 
-# core
-COBJS-y += usbdcore.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
-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
-COBJS-$(CONFIG_USB_EHCI_IXP4XX) += usb_ehci_ixp.o
-COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
-COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
-COBJS-$(CONFIG_USB_EHCI_VCT) += usb_ehci_vct.o
-
-# device
 ifdef CONFIG_USB_DEVICE
-COBJS-y += usbdcore_ep0.o
-COBJS-$(CONFIG_OMAP1510) += usbdcore_omap1510.o
-COBJS-$(CONFIG_OMAP1610) += usbdcore_omap1510.o
-COBJS-$(CONFIG_MPC885_FAMILY) += usbdcore_mpc8xx.o
+COBJS-y += core.o
+COBJS-y += ep0.o
+COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o
+COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o
+COBJS-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o
 endif
 
 COBJS	:= $(COBJS-y)
drivers/usb/gadget/core.c renamed from drivers/usb/usbdcore.c +1 -1
similarity index 99%
rename from drivers/usb/usbdcore.c
rename to drivers/usb/gadget/core.c
index 53ed669..67b6681 100644
@@ -30,7 +30,7 @@
  */
 
 #include <malloc.h>
-#include "usbdcore.h"
+#include <usbdevice.h>
 
 #define MAX_INTERFACES 2
 
drivers/usb/gadget/ep0.c renamed from drivers/usb/usbdcore_ep0.c +1 -1
similarity index 99%
rename from drivers/usb/usbdcore_ep0.c
rename to drivers/usb/gadget/ep0.c
index f6e017d..2b4ec44 100644
@@ -51,7 +51,7 @@
  */
 
 #include <common.h>
-#include "usbdcore.h"
+#include <usbdevice.h>
 
 #if 0
 #define dbg_ep0(lvl,fmt,args...) serial_printf("[%s] %s:%d: "fmt"\n",__FILE__,__FUNCTION__,__LINE__,##args)
drivers/usb/gadget/ep0.h renamed from include/usbdcore_ep0.h +0 -0
similarity index 100%
rename from include/usbdcore_ep0.h
rename to drivers/usb/gadget/ep0.h
drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +5 -4
similarity index 99%
rename from drivers/usb/usbdcore_mpc8xx.c
rename to drivers/usb/gadget/mpc8xx_udc.c
index 0e311ad..8d7bd65 100644
@@ -3,7 +3,7 @@
  * bodonoghue at CodeHermit.ie
  *
  * References
- * DasUBoot/drivers/usb/usbdcore_omap1510.c, for design and implementation
+ * DasUBoot/drivers/usb/omap1510_udc.c, for design and implementation
  * ideas.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -59,9 +59,10 @@
 #include <common.h>
 #include <config.h>
 #include <commproc.h>
-#include "usbdcore.h"
-#include "usbdcore_mpc8xx.h"
-#include "usbdcore_ep0.h"
+#include <usbdevice.h>
+#include <usb/mpc8xx_udc.h>
+
+#include "ep0.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/usb/gadget/omap1510_udc.c renamed from drivers/usb/usbdcore_omap1510.c +3 -3
similarity index 99%
rename from drivers/usb/usbdcore_omap1510.c
rename to drivers/usb/gadget/omap1510_udc.c
index 6b7b61b..90f7907 100644
@@ -31,10 +31,10 @@
 #ifdef CONFIG_OMAP_SX1
 #include <i2c.h>
 #endif
+#include <usbdevice.h>
+#include <usb/omap1510_udc.h>
 
-#include "usbdcore.h"
-#include "usbdcore_omap1510.h"
-#include "usbdcore_ep0.h"
+#include "ep0.h"
 
 
 #define UDC_INIT_MDELAY		     80 /* Device settle delay */
drivers/usb/host/Makefile renamed from drivers/usb/Makefile +12 -23
similarity index 65%
rename from drivers/usb/Makefile
rename to drivers/usb/host/Makefile
index 7ddb72a..f6c9299 100644
@@ -23,32 +23,21 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	:= $(obj)libusb.a
+LIB	:= $(obj)libusb_host.a
 
-# core
-COBJS-y += usbdcore.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
-COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
-
-# host
+# ohci
+COBJS-$(CONFIG_USB_OHCI_NEW) += ohci-hcd.o
 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
-COBJS-$(CONFIG_USB_EHCI_IXP4XX) += usb_ehci_ixp.o
-COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
-COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
-COBJS-$(CONFIG_USB_EHCI_VCT) += usb_ehci_vct.o
-
-# device
-ifdef CONFIG_USB_DEVICE
-COBJS-y += usbdcore_ep0.o
-COBJS-$(CONFIG_OMAP1510) += usbdcore_omap1510.o
-COBJS-$(CONFIG_OMAP1610) += usbdcore_omap1510.o
-COBJS-$(CONFIG_MPC885_FAMILY) += usbdcore_mpc8xx.o
-endif
+COBJS-$(CONFIG_USB_S3C64XX) += s3c64xx-hcd.o
+COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o
+
+# echi
+COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o
+COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
+COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
+COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o
+COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/usb/host/ehci-core.h renamed from drivers/usb/usb_ehci_core.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci_core.h
rename to drivers/usb/host/ehci-core.h
drivers/usb/host/ehci-fsl.c renamed from drivers/usb/usb_ehci_fsl.c +3 -3
similarity index 97%
rename from drivers/usb/usb_ehci_fsl.c
rename to drivers/usb/host/ehci-fsl.c
index 81d5d21..86ee1d5 100644
@@ -26,9 +26,9 @@
 #include <asm/io.h>
 #include <asm/bitops.h>
 
-#include "usb_ehci.h"
-#include "usb_ehci_fsl.h"
-#include "usb_ehci_core.h"
+#include "ehci.h"
+#include "ehci-fsl.h"
+#include "ehci-core.h"
 
 /*
  * Create the appropriate control structures to manage
drivers/usb/host/ehci-fsl.h renamed from drivers/usb/usb_ehci_fsl.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci_fsl.h
rename to drivers/usb/host/ehci-fsl.h
drivers/usb/host/ehci-hcd.c renamed from drivers/usb/usb_ehci_core.c +2 -1
similarity index 99%
rename from drivers/usb/usb_ehci_core.c
rename to drivers/usb/host/ehci-hcd.c
index 4dbfb66..bbd547b 100644
@@ -25,7 +25,8 @@
 #include <usb.h>
 #include <asm/io.h>
 #include <malloc.h>
-#include "usb_ehci.h"
+
+#include "ehci.h"
 
 int rootdev;
 struct ehci_hccr *hccr;	/* R/O registers, not need for volatile */
drivers/usb/host/ehci-ixp4xx.c renamed from drivers/usb/usb_ehci_ixp.c +3 -2
similarity index 96%
rename from drivers/usb/usb_ehci_ixp.c
rename to drivers/usb/host/ehci-ixp4xx.c
index 25c18c1..b8f15ae 100644
@@ -21,8 +21,9 @@
  */
 #include <common.h>
 #include <usb.h>
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+
+#include "ehci.h"
+#include "ehci-core.h"
 /*
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
drivers/usb/host/ehci-pci.c renamed from drivers/usb/usb_ehci_pci.c +3 -2
similarity index 97%
rename from drivers/usb/usb_ehci_pci.c
rename to drivers/usb/host/ehci-pci.c
index 3e7143c..441b1a2 100644
@@ -21,8 +21,9 @@
 #include <common.h>
 #include <pci.h>
 #include <usb.h>
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+
+#include "ehci.h"
+#include "ehci-core.h"
 
 #ifdef CONFIG_PCI_EHCI_DEVICE
 static struct pci_device_id ehci_pci_ids[] = {
drivers/usb/host/ehci-vct.c renamed from drivers/usb/usb_ehci_vct.c +2 -2
similarity index 96%
rename from drivers/usb/usb_ehci_vct.c
rename to drivers/usb/host/ehci-vct.c
index 89daaaf..3063dd1 100644
@@ -20,8 +20,8 @@
 #include <common.h>
 #include <usb.h>
 
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+#include "ehci.h"
+#include "ehci-core.h"
 
 int vct_ehci_hcd_init(u32 *hccr, u32 *hcor);
 
drivers/usb/host/ehci.h renamed from drivers/usb/usb_ehci.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci.h
rename to drivers/usb/host/ehci.h
drivers/usb/host/isp116x-hcd.c renamed from drivers/usb/isp116x-hcd.c +0 -0
similarity index 100%
rename from drivers/usb/isp116x-hcd.c
rename to drivers/usb/host/isp116x-hcd.c
drivers/usb/host/isp116x.h renamed from drivers/usb/isp116x.h +0 -0
similarity index 100%
rename from drivers/usb/isp116x.h
rename to drivers/usb/host/isp116x.h
drivers/usb/host/ohci-hcd.c renamed from drivers/usb/usb_ohci.c +2 -1
similarity index 99%
rename from drivers/usb/usb_ohci.c
rename to drivers/usb/host/ohci-hcd.c
index 0bbee0f..e2f289e 100644
@@ -57,7 +57,8 @@
 
 #include <malloc.h>
 #include <usb.h>
-#include "usb_ohci.h"
+
+#include "ohci.h"
 
 #ifdef CONFIG_AT91RM9200
 #include <asm/arch/hardware.h>	/* needed for AT91_USB_HOST_BASE */
drivers/usb/host/ohci.h renamed from drivers/usb/usb_ohci.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ohci.h
rename to drivers/usb/host/ohci.h
drivers/usb/host/r8a66597-hcd.c renamed from drivers/usb/r8a66597-hcd.c +0 -0
similarity index 100%
rename from drivers/usb/r8a66597-hcd.c
rename to drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/r8a66597.h renamed from drivers/usb/r8a66597.h +0 -0
similarity index 100%
rename from drivers/usb/r8a66597.h
rename to drivers/usb/host/r8a66597.h
drivers/usb/host/s3c64xx-hcd.c renamed from drivers/usb/s3c64xx_usb.c +0 -0
similarity index 100%
rename from drivers/usb/s3c64xx_usb.c
rename to drivers/usb/host/s3c64xx-hcd.c
drivers/usb/host/sl811-hcd.c renamed from drivers/usb/sl811_usb.c +1 -1
similarity index 99%
rename from drivers/usb/sl811_usb.c
rename to drivers/usb/host/sl811-hcd.c
index a03e469..82a8b36 100644
@@ -40,7 +40,7 @@
 #include <usb.h>
 #include "sl811.h"
 
-#include "../../board/kup/common/kup.h"
+#include "../../../board/kup/common/kup.h"
 
 #ifdef __PPC__
 # define EIEIO		__asm__ volatile ("eieio")
drivers/usb/host/sl811.h renamed from drivers/usb/sl811.h +0 -0
similarity index 100%
rename from drivers/usb/sl811.h
rename to drivers/usb/host/sl811.h
drivers/usb/musb/Makefile new file +47 -0

47 lines not on this page · raw message

drivers/usb/musb/davinci.c renamed from drivers/usb/davinci_usb.c +1 -1
similarity index 99%
rename from drivers/usb/davinci_usb.c
rename to drivers/usb/musb/davinci.c
index e66f660..a7648fc 100644
@@ -23,7 +23,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include "davinci_usb.h"
+#include "davinci.h"
 
 /* MUSB platform configuration */
 struct musb_config musb_cfg = {
drivers/usb/musb/davinci.h renamed from drivers/usb/davinci_usb.h +0 -0
similarity index 100%
rename from drivers/usb/davinci_usb.h
rename to drivers/usb/musb/davinci.h
drivers/usb/musb/musb_core.c renamed from drivers/usb/musb_core.c +0 -0
similarity index 100%
rename from drivers/usb/musb_core.c
rename to drivers/usb/musb/musb_core.c
drivers/usb/musb/musb_core.h renamed from drivers/usb/musb_core.h +0 -0
similarity index 100%
rename from drivers/usb/musb_core.h
rename to drivers/usb/musb/musb_core.h
drivers/usb/musb/musb_hcd.c renamed from drivers/usb/musb_hcd.c +0 -0
similarity index 100%
rename from drivers/usb/musb_hcd.c
rename to drivers/usb/musb/musb_hcd.c
drivers/usb/musb/musb_hcd.h renamed from drivers/usb/musb_hcd.h +0 -0
similarity index 100%
rename from drivers/usb/musb_hcd.h
rename to drivers/usb/musb/musb_hcd.h
include/usb/mpc8xx_udc.h renamed from include/usbdcore_mpc8xx.h +0 -0
similarity index 100%
rename from include/usbdcore_mpc8xx.h
rename to include/usb/mpc8xx_udc.h
include/usb/omap1510_udc.h renamed from include/usbdcore_omap1510.h +0 -0
similarity index 100%
rename from include/usbdcore_omap1510.h
rename to include/usb/omap1510_udc.h
include/usbdevice.h renamed from include/usbdcore.h +0 -0
similarity index 100%
rename from include/usbdcore.h
rename to include/usbdevice.h
Signature · 1 line
1.6.1.3
#43 lore raw

RFC PATCH v2 1/1 drivers/usb: regorganisation

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 6 lines · In message <[email protected]> you wrote:

move to linux usb driver organisation

---
Remy is this one ok for you?

Looks OK to me, but..

drivers/serial/usbtty.c static char serial_number[16]; · line 98

Quoted 11 lines
drivers/serial/usbtty.c +1 -1
index d8b1387..71f0e5b 100644
@@ -94,7 +94,7 @@ static char serial_number[16];
  * Descriptors, Strings, Local variables.
  */
 
-/* defined and used by usbdcore_ep0.c */
+/* defined and used by ep0.c */
 extern struct usb_string_descriptor **usb_strings;

This is now too short. Where might ep0.c be? Please use "gadget/ep0.c" here.

drivers/usb/gadget/mpc8xx_udc.c line 6

Quoted 10 lines

rename to drivers/usb/gadget/mpc8xx_udc.c
index 0e311ad..8d7bd65 100644

drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +1 -1
@@ -3,7 +3,7 @@
  * bodonoghue at CodeHermit.ie
  *
  * References
- * DasUBoot/drivers/usb/usbdcore_omap1510.c, for design and implementation
+ * DasUBoot/drivers/usb/omap1510_udc.c, for design and implementation

Please change into "drivers/usb/omap1510_udc.c"

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When a woman marries again it is because she detested her first  hus-
band.  When  a  man  marries again, it is because he adored his first
wife.                                                  -- Oscar Wilde
#44 lore raw

RFC PATCH v2 1/1 drivers/usb: regorganisation

Quoted 21 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 6 lines · In message <[email protected]> you wrote:

move to linux usb driver organisation

---
Remy is this one ok for you?

Looks OK to me, but..

Quoted 8 lines
drivers/serial/usbtty.c +0 -0
index d8b1387..71f0e5b 100644
@@ -94,7 +94,7 @@ static char serial_number[16];
  * Descriptors, Strings, Local variables.
  */
 
Quoted 6 lines

drivers/serial/usbtty.c static char serial_number[16]; · line 98

Quoted 3 lines
drivers/serial/usbtty.c +1 -1
-/* defined and used by usbdcore_ep0.c */
+/* defined and used by ep0.c */
 extern struct usb_string_descriptor **usb_strings;

This is now too short. Where might ep0.c be? Please use "gadget/ep0.c" here.

ok

Quoted 14 lines

drivers/usb/gadget/mpc8xx_udc.c line 6

Quoted 12 lines

rename to drivers/usb/gadget/mpc8xx_udc.c
index 0e311ad..8d7bd65 100644

drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +1 -1
@@ -3,7 +3,7 @@
  * bodonoghue at CodeHermit.ie
  *
  * References
- * DasUBoot/drivers/usb/usbdcore_omap1510.c, for design and implementation
+ * DasUBoot/drivers/usb/omap1510_udc.c, for design and implementation

Please change into "drivers/usb/omap1510_udc.c"

drivers/usb/gadget/omap1510_udc.c
ok

if Remy is ok
could apply the at91 pull request then I will generate the final usb reorganisation patch?

Best Regards,
J.

#45 lore raw

RFC PATCH v2 1/1 drivers/usb: regorganisation

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 4 lines · In message <[email protected]> you wrote:

if Remy is ok
could apply the at91 pull request then I will generate the final usb reorganisation patch?

That should go through the USB custodian tree.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I like your game but we have to change the rules."
#46 lore raw

RFC PATCH v2 1/1 drivers/usb: regorganisation

Quoted 9 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 4 lines · In message <[email protected]> you wrote:

if Remy is ok
could apply the at91 pull request then I will generate the final usb reorganisation patch?

That should go through the USB custodian tree.

the reorganisation patch ofcourse

In the a91 pull request I've move the at91 usb drivers if you can applied it I will base my reorganication patch on this

and the Remy will handle the reorganisation patch through it's tree ofcourse

Best Regards,
J.

#47 lore raw

PATCH 1/1 drivers/usb: regorganisation

In reply to Wolfgang Denk

move to linux usb driver organisation

as following

drivers/usb/gadget
drivers/usb/host
drivers/usb/musb

---
Hi Remy,
This version containt everyone ask
and is based on the AT91 tree
which contain the patch that move the at91 usb to drivers/usb

Best Regards,
J.

 Makefile                                           |    4 +-
 drivers/serial/usbtty.c                            |    2 +-
 drivers/serial/usbtty.h                            |    6 +-
 drivers/usb/{ => gadget}/Makefile                  |   30 +++----------
 drivers/usb/{usbdcore.c => gadget/core.c}          |    2 +-
 drivers/usb/{usbdcore_ep0.c => gadget/ep0.c}       |    2 +-
 include/usbdcore_ep0.h => drivers/usb/gadget/ep0.h |    0
 .../usb/{usbdcore_mpc8xx.c => gadget/mpc8xx_udc.c} |    9 ++--
 .../{usbdcore_omap1510.c => gadget/omap1510_udc.c} |    6 +-
 drivers/usb/{ => host}/Makefile                    |   37 +++++----------
 drivers/usb/{usb_ehci_core.h => host/ehci-core.h}  |    0
 drivers/usb/{usb_ehci_fsl.c => host/ehci-fsl.c}    |    6 +-
 drivers/usb/{usb_ehci_fsl.h => host/ehci-fsl.h}    |    0
 drivers/usb/{usb_ehci_core.c => host/ehci-hcd.c}   |    3 +-
 drivers/usb/{usb_ehci_ixp.c => host/ehci-ixp4xx.c} |    5 +-
 drivers/usb/{usb_ehci_pci.c => host/ehci-pci.c}    |    5 +-
 drivers/usb/{usb_ehci_vct.c => host/ehci-vct.c}    |    4 +-
 drivers/usb/{usb_ehci.h => host/ehci.h}            |    0
 drivers/usb/{ => host}/isp116x-hcd.c               |    0
 drivers/usb/{ => host}/isp116x.h                   |    0
 drivers/usb/{atmel_usb.c => host/ohci-at91.c}      |    0
 drivers/usb/{usb_ohci.c => host/ohci-hcd.c}        |    3 +-
 drivers/usb/{usb_ohci.h => host/ohci.h}            |    0
 drivers/usb/{ => host}/r8a66597-hcd.c              |    0
 drivers/usb/{ => host}/r8a66597.h                  |    0
 drivers/usb/{s3c64xx_usb.c => host/s3c64xx-hcd.c}  |    0
 drivers/usb/{sl811_usb.c => host/sl811-hcd.c}      |    2 +-
 drivers/usb/{ => host}/sl811.h                     |    0
 drivers/usb/musb/Makefile                          |   47 ++++++++++++++++++++
 drivers/usb/{davinci_usb.c => musb/davinci.c}      |    2 +-
 drivers/usb/{davinci_usb.h => musb/davinci.h}      |    0
 drivers/usb/{ => musb}/musb_core.c                 |    0
 drivers/usb/{ => musb}/musb_core.h                 |    0
 drivers/usb/{ => musb}/musb_hcd.c                  |    0
 drivers/usb/{ => musb}/musb_hcd.h                  |    0
 include/{usbdcore_mpc8xx.h => usb/mpc8xx_udc.h}    |    0
 .../{usbdcore_omap1510.h => usb/omap1510_udc.h}    |    0
 include/{usbdcore.h => usbdevice.h}                |    0
 38 files changed, 100 insertions(+), 75 deletions(-)
 copy drivers/usb/{ => gadget}/Makefile (60%)
 rename drivers/usb/{usbdcore.c => gadget/core.c} (99%)
 rename drivers/usb/{usbdcore_ep0.c => gadget/ep0.c} (99%)
 rename include/usbdcore_ep0.h => drivers/usb/gadget/ep0.h (100%)
 rename drivers/usb/{usbdcore_mpc8xx.c => gadget/mpc8xx_udc.c} (99%)
 rename drivers/usb/{usbdcore_omap1510.c => gadget/omap1510_udc.c} (99%)
 rename drivers/usb/{ => host}/Makefile (64%)
 rename drivers/usb/{usb_ehci_core.h => host/ehci-core.h} (100%)
 rename drivers/usb/{usb_ehci_fsl.c => host/ehci-fsl.c} (97%)
 rename drivers/usb/{usb_ehci_fsl.h => host/ehci-fsl.h} (100%)
 rename drivers/usb/{usb_ehci_core.c => host/ehci-hcd.c} (99%)
 rename drivers/usb/{usb_ehci_ixp.c => host/ehci-ixp4xx.c} (96%)
 rename drivers/usb/{usb_ehci_pci.c => host/ehci-pci.c} (97%)
 rename drivers/usb/{usb_ehci_vct.c => host/ehci-vct.c} (96%)
 rename drivers/usb/{usb_ehci.h => host/ehci.h} (100%)
 rename drivers/usb/{ => host}/isp116x-hcd.c (100%)
 rename drivers/usb/{ => host}/isp116x.h (100%)
 rename drivers/usb/{atmel_usb.c => host/ohci-at91.c} (100%)
 rename drivers/usb/{usb_ohci.c => host/ohci-hcd.c} (99%)
 rename drivers/usb/{usb_ohci.h => host/ohci.h} (100%)
 rename drivers/usb/{ => host}/r8a66597-hcd.c (100%)
 rename drivers/usb/{ => host}/r8a66597.h (100%)
 rename drivers/usb/{s3c64xx_usb.c => host/s3c64xx-hcd.c} (100%)
 rename drivers/usb/{sl811_usb.c => host/sl811-hcd.c} (99%)
 rename drivers/usb/{ => host}/sl811.h (100%)
 create mode 100644 drivers/usb/musb/Makefile
 rename drivers/usb/{davinci_usb.c => musb/davinci.c} (99%)
 rename drivers/usb/{davinci_usb.h => musb/davinci.h} (100%)
 rename drivers/usb/{ => musb}/musb_core.c (100%)
 rename drivers/usb/{ => musb}/musb_core.h (100%)
 rename drivers/usb/{ => musb}/musb_hcd.c (100%)
 rename drivers/usb/{ => musb}/musb_hcd.h (100%)
 rename include/{usbdcore_mpc8xx.h => usb/mpc8xx_udc.h} (100%)
 rename include/{usbdcore_omap1510.h => usb/omap1510_udc.h} (100%)
 rename include/{usbdcore.h => usbdevice.h} (100%)
Makefile +3 -1
index 39c1903..b946009 100644
@@ -263,7 +263,9 @@ endif
 LIBS += drivers/rtc/librtc.a
 LIBS += drivers/serial/libserial.a
 LIBS += drivers/twserial/libtws.a
-LIBS += drivers/usb/libusb.a
+LIBS += drivers/usb/gadget/libusb_gadget.a
+LIBS += drivers/usb/host/libusb_host.a
+LIBS += drivers/usb/musb/libusb_musb.a
 LIBS += drivers/video/libvideo.a
 LIBS += drivers/watchdog/libwatchdog.a
 LIBS += common/libcommon.a
drivers/serial/usbtty.c +1 -1
index d8b1387..f711d0b 100644
@@ -94,7 +94,7 @@ static char serial_number[16];
  * Descriptors, Strings, Local variables.
  */
 
-/* defined and used by usbdcore_ep0.c */
+/* defined and used by gadget/ep0.c */
 extern struct usb_string_descriptor **usb_strings;
 
 /* Indicies, References */
drivers/serial/usbtty.h +3 -3
index ecefde5..77db972 100644
@@ -24,11 +24,11 @@
 #ifndef __USB_TTY_H__
 #define __USB_TTY_H__
 
-#include <usbdcore.h>
+#include <usbdevice.h>
 #if defined(CONFIG_PPC)
-#include <usbdcore_mpc8xx.h>
+#include <usb/mpc8xx_udc.h>
 #elif defined(CONFIG_ARM)
-#include <usbdcore_omap1510.h>
+#include <usb/omap1510_udc.h>
 #endif
 
 #include <version_autogenerated.h>
drivers/usb/gadget/Makefile renamed from drivers/usb/Makefile +6 -24
similarity index 60%
copy from drivers/usb/Makefile
copy to drivers/usb/gadget/Makefile
index 5523cbd..251724f 100644
@@ -23,32 +23,14 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	:= $(obj)libusb.a
+LIB	:= $(obj)libusb_gadget.a
 
-# core
-COBJS-y += usbdcore.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
-COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
-
-# host
-COBJS-$(CONFIG_USB_ATMEL) += atmel_usb.o
-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
-COBJS-$(CONFIG_USB_EHCI_IXP4XX) += usb_ehci_ixp.o
-COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
-COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
-COBJS-$(CONFIG_USB_EHCI_VCT) += usb_ehci_vct.o
-
-# device
 ifdef CONFIG_USB_DEVICE
-COBJS-y += usbdcore_ep0.o
-COBJS-$(CONFIG_OMAP1510) += usbdcore_omap1510.o
-COBJS-$(CONFIG_OMAP1610) += usbdcore_omap1510.o
-COBJS-$(CONFIG_MPC885_FAMILY) += usbdcore_mpc8xx.o
+COBJS-y += core.o
+COBJS-y += ep0.o
+COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o
+COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o
+COBJS-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o
 endif
 
 COBJS	:= $(COBJS-y)
drivers/usb/gadget/core.c renamed from drivers/usb/usbdcore.c +1 -1
similarity index 99%
rename from drivers/usb/usbdcore.c
rename to drivers/usb/gadget/core.c
index 53ed669..67b6681 100644
@@ -30,7 +30,7 @@
  */
 
 #include <malloc.h>
-#include "usbdcore.h"
+#include <usbdevice.h>
 
 #define MAX_INTERFACES 2
 
drivers/usb/gadget/ep0.c renamed from drivers/usb/usbdcore_ep0.c +1 -1
similarity index 99%
rename from drivers/usb/usbdcore_ep0.c
rename to drivers/usb/gadget/ep0.c
index f6e017d..2b4ec44 100644
@@ -51,7 +51,7 @@
  */
 
 #include <common.h>
-#include "usbdcore.h"
+#include <usbdevice.h>
 
 #if 0
 #define dbg_ep0(lvl,fmt,args...) serial_printf("[%s] %s:%d: "fmt"\n",__FILE__,__FUNCTION__,__LINE__,##args)
drivers/usb/gadget/ep0.h renamed from include/usbdcore_ep0.h +0 -0
similarity index 100%
rename from include/usbdcore_ep0.h
rename to drivers/usb/gadget/ep0.h
drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +5 -4
similarity index 99%
rename from drivers/usb/usbdcore_mpc8xx.c
rename to drivers/usb/gadget/mpc8xx_udc.c
index 0e311ad..da3fbba 100644
@@ -3,7 +3,7 @@
  * bodonoghue at CodeHermit.ie
  *
  * References
- * DasUBoot/drivers/usb/usbdcore_omap1510.c, for design and implementation
+ * DasUBoot/drivers/usb/gadget/omap1510_udc.c, for design and implementation
  * ideas.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -59,9 +59,10 @@
 #include <common.h>
 #include <config.h>
 #include <commproc.h>
-#include "usbdcore.h"
-#include "usbdcore_mpc8xx.h"
-#include "usbdcore_ep0.h"
+#include <usbdevice.h>
+#include <usb/mpc8xx_udc.h>
+
+#include "ep0.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
drivers/usb/gadget/omap1510_udc.c renamed from drivers/usb/usbdcore_omap1510.c +3 -3
similarity index 99%
rename from drivers/usb/usbdcore_omap1510.c
rename to drivers/usb/gadget/omap1510_udc.c
index 6b7b61b..90f7907 100644
@@ -31,10 +31,10 @@
 #ifdef CONFIG_OMAP_SX1
 #include <i2c.h>
 #endif
+#include <usbdevice.h>
+#include <usb/omap1510_udc.h>
 
-#include "usbdcore.h"
-#include "usbdcore_omap1510.h"
-#include "usbdcore_ep0.h"
+#include "ep0.h"
 
 
 #define UDC_INIT_MDELAY		     80 /* Device settle delay */
drivers/usb/host/Makefile renamed from drivers/usb/Makefile +13 -24
similarity index 64%
rename from drivers/usb/Makefile
rename to drivers/usb/host/Makefile
index 5523cbd..ec1d689 100644
@@ -23,33 +23,22 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	:= $(obj)libusb.a
+LIB	:= $(obj)libusb_host.a
 
-# core
-COBJS-y += usbdcore.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
-COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
-
-# host
-COBJS-$(CONFIG_USB_ATMEL) += atmel_usb.o
+# ohci
+COBJS-$(CONFIG_USB_OHCI_NEW) += ohci-hcd.o
+COBJS-$(CONFIG_USB_ATMEL) += ohci-at91.o
 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
-COBJS-$(CONFIG_USB_EHCI_IXP4XX) += usb_ehci_ixp.o
-COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
-COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
-COBJS-$(CONFIG_USB_EHCI_VCT) += usb_ehci_vct.o
-
-# device
-ifdef CONFIG_USB_DEVICE
-COBJS-y += usbdcore_ep0.o
-COBJS-$(CONFIG_OMAP1510) += usbdcore_omap1510.o
-COBJS-$(CONFIG_OMAP1610) += usbdcore_omap1510.o
-COBJS-$(CONFIG_MPC885_FAMILY) += usbdcore_mpc8xx.o
-endif
+COBJS-$(CONFIG_USB_S3C64XX) += s3c64xx-hcd.o
+COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o
+
+# echi
+COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o
+COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
+COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o
+COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
+COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/usb/host/ehci-core.h renamed from drivers/usb/usb_ehci_core.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci_core.h
rename to drivers/usb/host/ehci-core.h
drivers/usb/host/ehci-fsl.c renamed from drivers/usb/usb_ehci_fsl.c +3 -3
similarity index 97%
rename from drivers/usb/usb_ehci_fsl.c
rename to drivers/usb/host/ehci-fsl.c
index 81d5d21..86ee1d5 100644
@@ -26,9 +26,9 @@
 #include <asm/io.h>
 #include <asm/bitops.h>
 
-#include "usb_ehci.h"
-#include "usb_ehci_fsl.h"
-#include "usb_ehci_core.h"
+#include "ehci.h"
+#include "ehci-fsl.h"
+#include "ehci-core.h"
 
 /*
  * Create the appropriate control structures to manage
drivers/usb/host/ehci-fsl.h renamed from drivers/usb/usb_ehci_fsl.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci_fsl.h
rename to drivers/usb/host/ehci-fsl.h
drivers/usb/host/ehci-hcd.c renamed from drivers/usb/usb_ehci_core.c +2 -1
similarity index 99%
rename from drivers/usb/usb_ehci_core.c
rename to drivers/usb/host/ehci-hcd.c
index 4dbfb66..bbd547b 100644
@@ -25,7 +25,8 @@
 #include <usb.h>
 #include <asm/io.h>
 #include <malloc.h>
-#include "usb_ehci.h"
+
+#include "ehci.h"
 
 int rootdev;
 struct ehci_hccr *hccr;	/* R/O registers, not need for volatile */
drivers/usb/host/ehci-ixp4xx.c renamed from drivers/usb/usb_ehci_ixp.c +3 -2
similarity index 96%
rename from drivers/usb/usb_ehci_ixp.c
rename to drivers/usb/host/ehci-ixp4xx.c
index 25c18c1..b8f15ae 100644
@@ -21,8 +21,9 @@
  */
 #include <common.h>
 #include <usb.h>
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+
+#include "ehci.h"
+#include "ehci-core.h"
 /*
  * Create the appropriate control structures to manage
  * a new EHCI host controller.
drivers/usb/host/ehci-pci.c renamed from drivers/usb/usb_ehci_pci.c +3 -2
similarity index 97%
rename from drivers/usb/usb_ehci_pci.c
rename to drivers/usb/host/ehci-pci.c
index 3e7143c..441b1a2 100644
@@ -21,8 +21,9 @@
 #include <common.h>
 #include <pci.h>
 #include <usb.h>
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+
+#include "ehci.h"
+#include "ehci-core.h"
 
 #ifdef CONFIG_PCI_EHCI_DEVICE
 static struct pci_device_id ehci_pci_ids[] = {
drivers/usb/host/ehci-vct.c renamed from drivers/usb/usb_ehci_vct.c +2 -2
similarity index 96%
rename from drivers/usb/usb_ehci_vct.c
rename to drivers/usb/host/ehci-vct.c
index 89daaaf..3063dd1 100644
@@ -20,8 +20,8 @@
 #include <common.h>
 #include <usb.h>
 
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+#include "ehci.h"
+#include "ehci-core.h"
 
 int vct_ehci_hcd_init(u32 *hccr, u32 *hcor);
 
drivers/usb/host/ehci.h renamed from drivers/usb/usb_ehci.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci.h
rename to drivers/usb/host/ehci.h
drivers/usb/host/isp116x-hcd.c renamed from drivers/usb/isp116x-hcd.c +0 -0
similarity index 100%
rename from drivers/usb/isp116x-hcd.c
rename to drivers/usb/host/isp116x-hcd.c
drivers/usb/host/isp116x.h renamed from drivers/usb/isp116x.h +0 -0
similarity index 100%
rename from drivers/usb/isp116x.h
rename to drivers/usb/host/isp116x.h
drivers/usb/host/ohci-at91.c renamed from drivers/usb/atmel_usb.c +0 -0
similarity index 100%
rename from drivers/usb/atmel_usb.c
rename to drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-hcd.c renamed from drivers/usb/usb_ohci.c +2 -1
similarity index 99%
rename from drivers/usb/usb_ohci.c
rename to drivers/usb/host/ohci-hcd.c
index 0bbee0f..e2f289e 100644
@@ -57,7 +57,8 @@
 
 #include <malloc.h>
 #include <usb.h>
-#include "usb_ohci.h"
+
+#include "ohci.h"
 
 #ifdef CONFIG_AT91RM9200
 #include <asm/arch/hardware.h>	/* needed for AT91_USB_HOST_BASE */
drivers/usb/host/ohci.h renamed from drivers/usb/usb_ohci.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ohci.h
rename to drivers/usb/host/ohci.h
drivers/usb/host/r8a66597-hcd.c renamed from drivers/usb/r8a66597-hcd.c +0 -0
similarity index 100%
rename from drivers/usb/r8a66597-hcd.c
rename to drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/r8a66597.h renamed from drivers/usb/r8a66597.h +0 -0
similarity index 100%
rename from drivers/usb/r8a66597.h
rename to drivers/usb/host/r8a66597.h
drivers/usb/host/s3c64xx-hcd.c renamed from drivers/usb/s3c64xx_usb.c +0 -0
similarity index 100%
rename from drivers/usb/s3c64xx_usb.c
rename to drivers/usb/host/s3c64xx-hcd.c
drivers/usb/host/sl811-hcd.c renamed from drivers/usb/sl811_usb.c +1 -1
similarity index 99%
rename from drivers/usb/sl811_usb.c
rename to drivers/usb/host/sl811-hcd.c
index a03e469..82a8b36 100644
@@ -40,7 +40,7 @@
 #include <usb.h>
 #include "sl811.h"
 
-#include "../../board/kup/common/kup.h"
+#include "../../../board/kup/common/kup.h"
 
 #ifdef __PPC__
 # define EIEIO		__asm__ volatile ("eieio")
drivers/usb/host/sl811.h renamed from drivers/usb/sl811.h +0 -0
similarity index 100%
rename from drivers/usb/sl811.h
rename to drivers/usb/host/sl811.h
drivers/usb/musb/Makefile new file +47 -0

47 lines not on this page · raw message

drivers/usb/musb/davinci.c renamed from drivers/usb/davinci_usb.c +1 -1
similarity index 99%
rename from drivers/usb/davinci_usb.c
rename to drivers/usb/musb/davinci.c
index e66f660..a7648fc 100644
@@ -23,7 +23,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include "davinci_usb.h"
+#include "davinci.h"
 
 /* MUSB platform configuration */
 struct musb_config musb_cfg = {
drivers/usb/musb/davinci.h renamed from drivers/usb/davinci_usb.h +0 -0
similarity index 100%
rename from drivers/usb/davinci_usb.h
rename to drivers/usb/musb/davinci.h
drivers/usb/musb/musb_core.c renamed from drivers/usb/musb_core.c +0 -0
similarity index 100%
rename from drivers/usb/musb_core.c
rename to drivers/usb/musb/musb_core.c
drivers/usb/musb/musb_core.h renamed from drivers/usb/musb_core.h +0 -0
similarity index 100%
rename from drivers/usb/musb_core.h
rename to drivers/usb/musb/musb_core.h
drivers/usb/musb/musb_hcd.c renamed from drivers/usb/musb_hcd.c +0 -0
similarity index 100%
rename from drivers/usb/musb_hcd.c
rename to drivers/usb/musb/musb_hcd.c
drivers/usb/musb/musb_hcd.h renamed from drivers/usb/musb_hcd.h +0 -0
similarity index 100%
rename from drivers/usb/musb_hcd.h
rename to drivers/usb/musb/musb_hcd.h
include/usb/mpc8xx_udc.h renamed from include/usbdcore_mpc8xx.h +0 -0
similarity index 100%
rename from include/usbdcore_mpc8xx.h
rename to include/usb/mpc8xx_udc.h
include/usb/omap1510_udc.h renamed from include/usbdcore_omap1510.h +0 -0
similarity index 100%
rename from include/usbdcore_omap1510.h
rename to include/usb/omap1510_udc.h
include/usbdevice.h renamed from include/usbdcore.h +0 -0
similarity index 100%
rename from include/usbdcore.h
rename to include/usbdevice.h
Signature · 1 line
1.6.1.3
#48 lore raw

PATCH 1/1 drivers/usb: regorganisation

Hello Jean-Christophe,

2009/4/3 Jean-Christophe PLAGNIOL-VILLARD <[email protected]>:

Quoted 8 lines

move to linux usb driver organisation

as following

drivers/usb/gadget
drivers/usb/host
drivers/usb/musb

Quoted 7 lines

---
Hi Remy,
This version containt everyone ask
and is based on the AT91 tree
which contain the patch that move the at91 usb to drivers/usb

I will wait until the at91 has been pulled by mainline, then I can integrate this patch in the usb-branch

Thanks.

Remy

Quoted 587 lines

Best Regards,
J.

?Makefile ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ?4 +-
?drivers/serial/usbtty.c ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ?2 +-
?drivers/serial/usbtty.h ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ?6 +-
?drivers/usb/{ => gadget}/Makefile ? ? ? ? ? ? ? ? ?| ? 30 +++----------
?drivers/usb/{usbdcore.c => gadget/core.c} ? ? ? ? ?| ? ?2 +-
?drivers/usb/{usbdcore_ep0.c => gadget/ep0.c} ? ? ? | ? ?2 +-
?include/usbdcore_ep0.h => drivers/usb/gadget/ep0.h | ? ?0
?.../usb/{usbdcore_mpc8xx.c => gadget/mpc8xx_udc.c} | ? ?9 ++--
?.../{usbdcore_omap1510.c => gadget/omap1510_udc.c} | ? ?6 +-
?drivers/usb/{ => host}/Makefile ? ? ? ? ? ? ? ? ? ?| ? 37 +++++----------
?drivers/usb/{usb_ehci_core.h => host/ehci-core.h} ?| ? ?0
?drivers/usb/{usb_ehci_fsl.c => host/ehci-fsl.c} ? ?| ? ?6 +-
?drivers/usb/{usb_ehci_fsl.h => host/ehci-fsl.h} ? ?| ? ?0
?drivers/usb/{usb_ehci_core.c => host/ehci-hcd.c} ? | ? ?3 +-
?drivers/usb/{usb_ehci_ixp.c => host/ehci-ixp4xx.c} | ? ?5 +-
?drivers/usb/{usb_ehci_pci.c => host/ehci-pci.c} ? ?| ? ?5 +-
?drivers/usb/{usb_ehci_vct.c => host/ehci-vct.c} ? ?| ? ?4 +-
?drivers/usb/{usb_ehci.h => host/ehci.h} ? ? ? ? ? ?| ? ?0
?drivers/usb/{ => host}/isp116x-hcd.c ? ? ? ? ? ? ? | ? ?0
?drivers/usb/{ => host}/isp116x.h ? ? ? ? ? ? ? ? ? | ? ?0
?drivers/usb/{atmel_usb.c => host/ohci-at91.c} ? ? ?| ? ?0
?drivers/usb/{usb_ohci.c => host/ohci-hcd.c} ? ? ? ?| ? ?3 +-
?drivers/usb/{usb_ohci.h => host/ohci.h} ? ? ? ? ? ?| ? ?0
?drivers/usb/{ => host}/r8a66597-hcd.c ? ? ? ? ? ? ?| ? ?0
?drivers/usb/{ => host}/r8a66597.h ? ? ? ? ? ? ? ? ?| ? ?0
?drivers/usb/{s3c64xx_usb.c => host/s3c64xx-hcd.c} ?| ? ?0
?drivers/usb/{sl811_usb.c => host/sl811-hcd.c} ? ? ?| ? ?2 +-
?drivers/usb/{ => host}/sl811.h ? ? ? ? ? ? ? ? ? ? | ? ?0
?drivers/usb/musb/Makefile ? ? ? ? ? ? ? ? ? ? ? ? ?| ? 47 ++++++++++++++++++++
?drivers/usb/{davinci_usb.c => musb/davinci.c} ? ? ?| ? ?2 +-
?drivers/usb/{davinci_usb.h => musb/davinci.h} ? ? ?| ? ?0
?drivers/usb/{ => musb}/musb_core.c ? ? ? ? ? ? ? ? | ? ?0
?drivers/usb/{ => musb}/musb_core.h ? ? ? ? ? ? ? ? | ? ?0
?drivers/usb/{ => musb}/musb_hcd.c ? ? ? ? ? ? ? ? ?| ? ?0
?drivers/usb/{ => musb}/musb_hcd.h ? ? ? ? ? ? ? ? ?| ? ?0
?include/{usbdcore_mpc8xx.h => usb/mpc8xx_udc.h} ? ?| ? ?0
?.../{usbdcore_omap1510.h => usb/omap1510_udc.h} ? ?| ? ?0
?include/{usbdcore.h => usbdevice.h} ? ? ? ? ? ? ? ?| ? ?0

?38 files changed, 100 insertions(+), 75 deletions(-)
?copy drivers/usb/{ => gadget}/Makefile (60%)
?rename drivers/usb/{usbdcore.c => gadget/core.c} (99%) ?rename drivers/usb/{usbdcore_ep0.c => gadget/ep0.c} (99%) ?rename include/usbdcore_ep0.h => drivers/usb/gadget/ep0.h (100%) ?rename drivers/usb/{usbdcore_mpc8xx.c => gadget/mpc8xx_udc.c} (99%) ?rename drivers/usb/{usbdcore_omap1510.c => gadget/omap1510_udc.c} (99%) ?rename drivers/usb/{ => host}/Makefile (64%)
?rename drivers/usb/{usb_ehci_core.h => host/ehci-core.h} (100%) ?rename drivers/usb/{usb_ehci_fsl.c => host/ehci-fsl.c} (97%) ?rename drivers/usb/{usb_ehci_fsl.h => host/ehci-fsl.h} (100%) ?rename drivers/usb/{usb_ehci_core.c => host/ehci-hcd.c} (99%) ?rename drivers/usb/{usb_ehci_ixp.c => host/ehci-ixp4xx.c} (96%) ?rename drivers/usb/{usb_ehci_pci.c => host/ehci-pci.c} (97%) ?rename drivers/usb/{usb_ehci_vct.c => host/ehci-vct.c} (96%) ?rename drivers/usb/{usb_ehci.h => host/ehci.h} (100%) ?rename drivers/usb/{ => host}/isp116x-hcd.c (100%)
?rename drivers/usb/{ => host}/isp116x.h (100%)
?rename drivers/usb/{atmel_usb.c => host/ohci-at91.c} (100%) ?rename drivers/usb/{usb_ohci.c => host/ohci-hcd.c} (99%) ?rename drivers/usb/{usb_ohci.h => host/ohci.h} (100%) ?rename drivers/usb/{ => host}/r8a66597-hcd.c (100%)
?rename drivers/usb/{ => host}/r8a66597.h (100%)
?rename drivers/usb/{s3c64xx_usb.c => host/s3c64xx-hcd.c} (100%) ?rename drivers/usb/{sl811_usb.c => host/sl811-hcd.c} (99%) ?rename drivers/usb/{ => host}/sl811.h (100%)
?create mode 100644 drivers/usb/musb/Makefile
?rename drivers/usb/{davinci_usb.c => musb/davinci.c} (99%) ?rename drivers/usb/{davinci_usb.h => musb/davinci.h} (100%) ?rename drivers/usb/{ => musb}/musb_core.c (100%)
?rename drivers/usb/{ => musb}/musb_core.h (100%)
?rename drivers/usb/{ => musb}/musb_hcd.c (100%)
?rename drivers/usb/{ => musb}/musb_hcd.h (100%)
?rename include/{usbdcore_mpc8xx.h => usb/mpc8xx_udc.h} (100%) ?rename include/{usbdcore_omap1510.h => usb/omap1510_udc.h} (100%) ?rename include/{usbdcore.h => usbdevice.h} (100%)

Makefile +0 -0
index 39c1903..b946009 100644
@@ -263,7 +263,9 @@ endif

?LIBS += drivers/rtc/librtc.a
?LIBS += drivers/serial/libserial.a
?LIBS += drivers/twserial/libtws.a

Makefile +3 -1
-LIBS += drivers/usb/libusb.a
+LIBS += drivers/usb/gadget/libusb_gadget.a
+LIBS += drivers/usb/host/libusb_host.a
+LIBS += drivers/usb/musb/libusb_musb.a

?LIBS += drivers/video/libvideo.a
?LIBS += drivers/watchdog/libwatchdog.a
?LIBS += common/libcommon.a

drivers/serial/usbtty.c +0 -0
index d8b1387..f711d0b 100644
@@ -94,7 +94,7 @@ static char serial_number[16];

?* Descriptors, Strings, Local variables.
?*/

drivers/serial/usbtty.c +1 -1
-/* defined and used by usbdcore_ep0.c */
+/* defined and used by gadget/ep0.c */

?extern struct usb_string_descriptor **usb_strings;

?/* Indicies, References */

drivers/serial/usbtty.h +0 -0
index ecefde5..77db972 100644
@@ -24,11 +24,11 @@

?#ifndef __USB_TTY_H__
?#define __USB_TTY_H__

drivers/serial/usbtty.h +1 -1
-#include <usbdcore.h>
+#include <usbdevice.h>

?#if defined(CONFIG_PPC)

drivers/serial/usbtty.h +1 -1
-#include <usbdcore_mpc8xx.h>
+#include <usb/mpc8xx_udc.h>

?#elif defined(CONFIG_ARM)

drivers/serial/usbtty.h +1 -1
-#include <usbdcore_omap1510.h>
+#include <usb/omap1510_udc.h>

?#endif

?#include <version_autogenerated.h>

drivers/usb/gadget/Makefile renamed from drivers/usb/Makefile +0 -0
similarity index 60%
copy from drivers/usb/Makefile
copy to drivers/usb/gadget/Makefile
index 5523cbd..251724f 100644
@@ -23,32 +23,14 @@
 

?include $(TOPDIR)/config.mk

drivers/usb/gadget/Makefile renamed from drivers/usb/Makefile +1 -20
-LIB ? ?:= $(obj)libusb.a
+LIB ? ?:= $(obj)libusb_gadget.a
 
-# core
-COBJS-y += usbdcore.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
-COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
-
-# host
-COBJS-$(CONFIG_USB_ATMEL) += atmel_usb.o
-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
-COBJS-$(CONFIG_USB_EHCI_IXP4XX) += usb_ehci_ixp.o
-COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
-COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
-COBJS-$(CONFIG_USB_EHCI_VCT) += usb_ehci_vct.o
-
-# device

?ifdef CONFIG_USB_DEVICE

drivers/usb/gadget/Makefile renamed from drivers/usb/Makefile +5 -4
-COBJS-y += usbdcore_ep0.o
-COBJS-$(CONFIG_OMAP1510) += usbdcore_omap1510.o
-COBJS-$(CONFIG_OMAP1610) += usbdcore_omap1510.o
-COBJS-$(CONFIG_MPC885_FAMILY) += usbdcore_mpc8xx.o
+COBJS-y += core.o
+COBJS-y += ep0.o
+COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o
+COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o
+COBJS-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o

?endif

?COBJS ?:= $(COBJS-y)

drivers/usb/gadget/core.c renamed from drivers/usb/usbdcore.c +0 -0
similarity index 99%
rename from drivers/usb/usbdcore.c
rename to drivers/usb/gadget/core.c
index 53ed669..67b6681 100644
@@ -30,7 +30,7 @@

?*/

?#include <malloc.h>

drivers/usb/gadget/core.c renamed from drivers/usb/usbdcore.c +1 -1
-#include "usbdcore.h"
+#include <usbdevice.h>

?#define MAX_INTERFACES 2

drivers/usb/gadget/ep0.c renamed from drivers/usb/usbdcore_ep0.c +0 -0
similarity index 99%
rename from drivers/usb/usbdcore_ep0.c
rename to drivers/usb/gadget/ep0.c
index f6e017d..2b4ec44 100644
@@ -51,7 +51,7 @@

?*/

?#include <common.h>

drivers/usb/gadget/ep0.c renamed from drivers/usb/usbdcore_ep0.c +1 -1
-#include "usbdcore.h"
+#include <usbdevice.h>

?#if 0
?#define dbg_ep0(lvl,fmt,args...) serial_printf("[%s] %s:%d: "fmt"\n",__FILE__,__FUNCTION__,__LINE__,##args)

drivers/usb/gadget/ep0.h renamed from include/usbdcore_ep0.h +0 -0
similarity index 100%
rename from include/usbdcore_ep0.h
rename to drivers/usb/gadget/ep0.h
drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +0 -0
similarity index 99%
rename from drivers/usb/usbdcore_mpc8xx.c
rename to drivers/usb/gadget/mpc8xx_udc.c
index 0e311ad..da3fbba 100644
@@ -3,7 +3,7 @@

?* bodonoghue at CodeHermit.ie
?*
?* References
- * DasUBoot/drivers/usb/usbdcore_omap1510.c, for design and implementation
+ * DasUBoot/drivers/usb/gadget/omap1510_udc.c, for design and implementation ?* ideas.
?*
?* This program is free software; you can redistribute it and/or modify

drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +0 -0
@@ -59,9 +59,10 @@

?#include <common.h>
?#include <config.h>
?#include <commproc.h>

drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +4 -3
-#include "usbdcore.h"
-#include "usbdcore_mpc8xx.h"
-#include "usbdcore_ep0.h"
+#include <usbdevice.h>
+#include <usb/mpc8xx_udc.h>
+
+#include "ep0.h"

?DECLARE_GLOBAL_DATA_PTR;

drivers/usb/gadget/omap1510_udc.c renamed from drivers/usb/usbdcore_omap1510.c +0 -0
similarity index 99%
rename from drivers/usb/usbdcore_omap1510.c
rename to drivers/usb/gadget/omap1510_udc.c
index 6b7b61b..90f7907 100644
@@ -31,10 +31,10 @@

?#ifdef CONFIG_OMAP_SX1
?#include <i2c.h>
?#endif

drivers/usb/gadget/omap1510_udc.c renamed from drivers/usb/usbdcore_omap1510.c +3 -3
+#include <usbdevice.h>
+#include <usb/omap1510_udc.h>
 
-#include "usbdcore.h"
-#include "usbdcore_omap1510.h"
-#include "usbdcore_ep0.h"
+#include "ep0.h"

?#define UDC_INIT_MDELAY ? ? ? ? ? ? ? ? ? ? 80 /* Device settle delay */

drivers/usb/host/Makefile renamed from drivers/usb/Makefile +0 -0
similarity index 64%
rename from drivers/usb/Makefile
rename to drivers/usb/host/Makefile
index 5523cbd..ec1d689 100644
@@ -23,33 +23,22 @@
 

?include $(TOPDIR)/config.mk

drivers/usb/host/Makefile renamed from drivers/usb/Makefile +4 -8
-LIB ? ?:= $(obj)libusb.a
+LIB ? ?:= $(obj)libusb_host.a
 
-# core
-COBJS-y += usbdcore.o
-COBJS-$(CONFIG_USB_OHCI_NEW) += usb_ohci.o
-COBJS-$(CONFIG_USB_EHCI) += usb_ehci_core.o
-
-# host
-COBJS-$(CONFIG_USB_ATMEL) += atmel_usb.o
+# ohci
+COBJS-$(CONFIG_USB_OHCI_NEW) += ohci-hcd.o
+COBJS-$(CONFIG_USB_ATMEL) += ohci-at91.o

?COBJS-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o ?COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o

drivers/usb/host/Makefile renamed from drivers/usb/Makefile +9 -16
-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
-COBJS-$(CONFIG_USB_EHCI_IXP4XX) += usb_ehci_ixp.o
-COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
-COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
-COBJS-$(CONFIG_USB_EHCI_VCT) += usb_ehci_vct.o
-
-# device
-ifdef CONFIG_USB_DEVICE
-COBJS-y += usbdcore_ep0.o
-COBJS-$(CONFIG_OMAP1510) += usbdcore_omap1510.o
-COBJS-$(CONFIG_OMAP1610) += usbdcore_omap1510.o
-COBJS-$(CONFIG_MPC885_FAMILY) += usbdcore_mpc8xx.o
-endif
+COBJS-$(CONFIG_USB_S3C64XX) += s3c64xx-hcd.o
+COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o
+
+# echi
+COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o
+COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
+COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o
+COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
+COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o

?COBJS ?:= $(COBJS-y)
?SRCS ? := $(COBJS:.o=.c)

drivers/usb/host/ehci-core.h renamed from drivers/usb/usb_ehci_core.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci_core.h
rename to drivers/usb/host/ehci-core.h
drivers/usb/host/ehci-fsl.c renamed from drivers/usb/usb_ehci_fsl.c +0 -0
similarity index 97%
rename from drivers/usb/usb_ehci_fsl.c
rename to drivers/usb/host/ehci-fsl.c
index 81d5d21..86ee1d5 100644
@@ -26,9 +26,9 @@

?#include <asm/io.h>
?#include <asm/bitops.h>

drivers/usb/host/ehci-fsl.c renamed from drivers/usb/usb_ehci_fsl.c +3 -3
-#include "usb_ehci.h"
-#include "usb_ehci_fsl.h"
-#include "usb_ehci_core.h"
+#include "ehci.h"
+#include "ehci-fsl.h"
+#include "ehci-core.h"

?/*
?* Create the appropriate control structures to manage

drivers/usb/host/ehci-fsl.h renamed from drivers/usb/usb_ehci_fsl.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci_fsl.h
rename to drivers/usb/host/ehci-fsl.h
drivers/usb/host/ehci-hcd.c renamed from drivers/usb/usb_ehci_core.c +0 -0
similarity index 99%
rename from drivers/usb/usb_ehci_core.c
rename to drivers/usb/host/ehci-hcd.c
index 4dbfb66..bbd547b 100644
@@ -25,7 +25,8 @@

?#include <usb.h>
?#include <asm/io.h>
?#include <malloc.h>

drivers/usb/host/ehci-hcd.c renamed from drivers/usb/usb_ehci_core.c +2 -1
-#include "usb_ehci.h"
+
+#include "ehci.h"

?int rootdev;
?struct ehci_hccr *hccr; ? ? ? ?/* R/O registers, not need for volatile */

drivers/usb/host/ehci-ixp4xx.c renamed from drivers/usb/usb_ehci_ixp.c +0 -0
similarity index 96%
rename from drivers/usb/usb_ehci_ixp.c
rename to drivers/usb/host/ehci-ixp4xx.c
index 25c18c1..b8f15ae 100644
@@ -21,8 +21,9 @@

?*/
?#include <common.h>
?#include <usb.h>

drivers/usb/host/ehci-ixp4xx.c renamed from drivers/usb/usb_ehci_ixp.c +3 -2
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+
+#include "ehci.h"
+#include "ehci-core.h"

?/*
?* Create the appropriate control structures to manage ?* a new EHCI host controller.

drivers/usb/host/ehci-pci.c renamed from drivers/usb/usb_ehci_pci.c +0 -0
similarity index 97%
rename from drivers/usb/usb_ehci_pci.c
rename to drivers/usb/host/ehci-pci.c
index 3e7143c..441b1a2 100644
@@ -21,8 +21,9 @@

?#include <common.h>
?#include <pci.h>
?#include <usb.h>

drivers/usb/host/ehci-pci.c renamed from drivers/usb/usb_ehci_pci.c +3 -2
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+
+#include "ehci.h"
+#include "ehci-core.h"

?#ifdef CONFIG_PCI_EHCI_DEVICE
?static struct pci_device_id ehci_pci_ids[] = {

drivers/usb/host/ehci-vct.c renamed from drivers/usb/usb_ehci_vct.c +0 -0
similarity index 96%
rename from drivers/usb/usb_ehci_vct.c
rename to drivers/usb/host/ehci-vct.c
index 89daaaf..3063dd1 100644
@@ -20,8 +20,8 @@

?#include <common.h>
?#include <usb.h>

drivers/usb/host/ehci-vct.c renamed from drivers/usb/usb_ehci_vct.c +2 -2
-#include "usb_ehci.h"
-#include "usb_ehci_core.h"
+#include "ehci.h"
+#include "ehci-core.h"

?int vct_ehci_hcd_init(u32 *hccr, u32 *hcor);

drivers/usb/host/ehci.h renamed from drivers/usb/usb_ehci.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ehci.h
rename to drivers/usb/host/ehci.h
drivers/usb/host/isp116x-hcd.c renamed from drivers/usb/isp116x-hcd.c +0 -0
similarity index 100%
rename from drivers/usb/isp116x-hcd.c
rename to drivers/usb/host/isp116x-hcd.c
drivers/usb/host/isp116x.h renamed from drivers/usb/isp116x.h +0 -0
similarity index 100%
rename from drivers/usb/isp116x.h
rename to drivers/usb/host/isp116x.h
drivers/usb/host/ohci-at91.c renamed from drivers/usb/atmel_usb.c +0 -0
similarity index 100%
rename from drivers/usb/atmel_usb.c
rename to drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-hcd.c renamed from drivers/usb/usb_ohci.c +0 -0
similarity index 99%
rename from drivers/usb/usb_ohci.c
rename to drivers/usb/host/ohci-hcd.c
index 0bbee0f..e2f289e 100644
@@ -57,7 +57,8 @@
 

?#include <malloc.h>
?#include <usb.h>

drivers/usb/host/ohci-hcd.c renamed from drivers/usb/usb_ohci.c +2 -1
-#include "usb_ohci.h"
+
+#include "ohci.h"

?#ifdef CONFIG_AT91RM9200
?#include <asm/arch/hardware.h> /* needed for AT91_USB_HOST_BASE */

drivers/usb/host/ohci.h renamed from drivers/usb/usb_ohci.h +0 -0
similarity index 100%
rename from drivers/usb/usb_ohci.h
rename to drivers/usb/host/ohci.h
drivers/usb/host/r8a66597-hcd.c renamed from drivers/usb/r8a66597-hcd.c +0 -0
similarity index 100%
rename from drivers/usb/r8a66597-hcd.c
rename to drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/r8a66597.h renamed from drivers/usb/r8a66597.h +0 -0
similarity index 100%
rename from drivers/usb/r8a66597.h
rename to drivers/usb/host/r8a66597.h
drivers/usb/host/s3c64xx-hcd.c renamed from drivers/usb/s3c64xx_usb.c +0 -0
similarity index 100%
rename from drivers/usb/s3c64xx_usb.c
rename to drivers/usb/host/s3c64xx-hcd.c
drivers/usb/host/sl811-hcd.c renamed from drivers/usb/sl811_usb.c +0 -0
similarity index 99%
rename from drivers/usb/sl811_usb.c
rename to drivers/usb/host/sl811-hcd.c
index a03e469..82a8b36 100644
@@ -40,7 +40,7 @@

?#include <usb.h>
?#include "sl811.h"

drivers/usb/host/sl811-hcd.c renamed from drivers/usb/sl811_usb.c +1 -1
-#include "../../board/kup/common/kup.h"
+#include "../../../board/kup/common/kup.h"

?#ifdef __PPC__
?# define EIEIO ? ? ? ? __asm__ volatile ("eieio")

drivers/usb/host/sl811.h renamed from drivers/usb/sl811.h +0 -0
similarity index 100%
rename from drivers/usb/sl811.h
rename to drivers/usb/host/sl811.h
drivers/usb/musb/Makefile new file +47 -0
new file mode 100644
index 0000000..09e0a5f
@@ -0,0 +1,47 @@
+#
+# (C) Copyright 2000-2007
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB ? ?:= $(obj)libusb_musb.a
+
+COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
+COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
+
+COBJS ?:= $(COBJS-y)
+SRCS ? := $(COBJS:.o=.c)
+OBJS ? := $(addprefix $(obj),$(COBJS))
+
+all: ? $(LIB)
+
+$(LIB): ? ? ? ?$(obj).depend $(OBJS)
+ ? ? ? $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
drivers/usb/musb/davinci.c renamed from drivers/usb/davinci_usb.c +0 -0
similarity index 99%
rename from drivers/usb/davinci_usb.c
rename to drivers/usb/musb/davinci.c
index e66f660..a7648fc 100644
@@ -23,7 +23,7 @@
 

?#include <common.h>
?#include <asm/io.h>

drivers/usb/musb/davinci.c renamed from drivers/usb/davinci_usb.c +1 -1
-#include "davinci_usb.h"
+#include "davinci.h"

?/* MUSB platform configuration */
?struct musb_config musb_cfg = {

drivers/usb/musb/davinci.h renamed from drivers/usb/davinci_usb.h +0 -0
similarity index 100%
rename from drivers/usb/davinci_usb.h
rename to drivers/usb/musb/davinci.h
drivers/usb/musb/musb_core.c renamed from drivers/usb/musb_core.c +0 -0
similarity index 100%
rename from drivers/usb/musb_core.c
rename to drivers/usb/musb/musb_core.c
drivers/usb/musb/musb_core.h renamed from drivers/usb/musb_core.h +0 -0
similarity index 100%
rename from drivers/usb/musb_core.h
rename to drivers/usb/musb/musb_core.h
drivers/usb/musb/musb_hcd.c renamed from drivers/usb/musb_hcd.c +0 -0
similarity index 100%
rename from drivers/usb/musb_hcd.c
rename to drivers/usb/musb/musb_hcd.c
drivers/usb/musb/musb_hcd.h renamed from drivers/usb/musb_hcd.h +0 -0
similarity index 100%
rename from drivers/usb/musb_hcd.h
rename to drivers/usb/musb/musb_hcd.h
include/usb/mpc8xx_udc.h renamed from include/usbdcore_mpc8xx.h +0 -0
similarity index 100%
rename from include/usbdcore_mpc8xx.h
rename to include/usb/mpc8xx_udc.h
include/usb/omap1510_udc.h renamed from include/usbdcore_omap1510.h +0 -0
similarity index 100%
rename from include/usbdcore_omap1510.h
rename to include/usb/omap1510_udc.h
include/usbdevice.h renamed from include/usbdcore.h +0 -1
similarity index 100%
rename from include/usbdcore.h
rename to include/usbdevice.h
--

1.6.1.3

#49 lore raw

RFC PATCH 1/1 drivers/usb: regorganisation

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · On Wednesday 01 April 2009 13:21:19 Jean-Christophe PLAGNIOL-VILLARD wrote:
 drivers/usb/{ => gadget}/Makefile            |   19 +------------------
 drivers/usb/{ => gadget}/usbdcore_ep0.c      |    2 +-
 drivers/usb/{ => gadget}/usbdcore_mpc8xx.c   |    4 ++--
 drivers/usb/{ => gadget}/usbdcore_omap1510.c |    4 ++--

sounds like a good idea ... the task of identifying available gadget drivers has been a pain with the current setup.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090402/ca0fdd23/attachment-0001.pgp

#50 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to Stefan Roese
Quoted 9 lines · Stefan Roese
Quoted 1 line · Michael Trimarchi

It is just a glue code in linux. Maybe it will be simple if you create

a

Quoted 2 lines

core direcory
and a host directory under the usb. An move the specific part in the

host.

Yes, I like this idea. This gets us closer to the Linux directory structure.

I agree. Drivers are going under drivers/ so it is OK. Generic ones should be kept right under drivers/something, platform specific go under drivers/something/host.

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

#51 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to Remy Bohmer
Quoted 15 lines · Remy Bohmer

Hello Stefan,

Quoted 1 line

From what I remember we all agreed to move the device drivers (e.g.

ethernet,

Quoted 1 line

NAND, USB, serial etc) from the architecture/board (cpu/... board/...)

to the

Quoted 3 lines

drivers directories at some time.

Speaking for PPC4xx, the 4xx ethernet driver has recently been moved

from

Quoted 1 line

cpu/ppc4xx to drivers/net. And I'm planning to move the 4xx NAND

driver (and

Quoted 3 lines

others) soon too.

So if this atmel_usb.c driver isn't just platform USB init code, but a

Quoted 8 lines

real

Quoted 1 line

USB driver, then I'm voting to move it to drivers/usb as well.

And that is exactly the issue here. The discussion is about moving 'platform USB init code' to generic driver code.
I would have no problems with moving real USB drivers to the generic driver section, if they are cleaned from board specific code, of course.

Board specific code belongs to $(BOARD).c. It does _NOT_ belong to cpu/* either so it should be moved to $(BOARD).c no matter where that platform driver resides.

That is why we should put something like platform_$(DRIVER)_init() in all those drivers (most of them do already have it, see e.g. I2C drivers) and move that portion in board specific functions in $(BOARD).c.

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

#52 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to Stefan Roese
Quoted 29 lines · Stefan Roese
Quoted 4 lines · Wolfgang Denk
Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 3 lines
Quoted 3 lines

?drivers/usb/Makefile ? ? ? ? ? ? ? ? ? ? ? ?> ? ? ? | ? ?1 + ?.../at91/usb.c => drivers/usb/atmel_usb.c ? ? ? ? ?| ?> ?0 ?rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c

(100%)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Same here, this is architecture specific code, why move it to

generic

Quoted 9 lines
Quoted 3 lines
Quoted 1 line

cod> e?

it's the at91 usb drivers and we need to have it in the driver/usb

Why do we need to have it in the driver/usb ?

Please explain in detail.

From what I remember we all agreed to move the device drivers (e.g.

ethernet,
NAND, USB, serial etc) from the architecture/board (cpu/... board/...) to the
drivers directories at some time.

Speaking for PPC4xx, the 4xx ethernet driver has recently been moved from
cpu/ppc4xx to drivers/net. And I'm planning to move the 4xx NAND driver (and
others) soon too.

Quoted 3 lines

So if this atmel_usb.c driver isn't just platform USB init code, but a real
USB driver, then I'm voting to move it to drivers/usb as well.

I also vote for moving _ALL_ the drivers (i2c, usb, net, etc.) to appropriate directories under drivers/ no matter architecture specific they are or not.

This will make the tree more logical and one wouldn't have to chase say USB driver all over the source tree.

Also it is a first step to general overhaul that would allow for multiple drivers support. The fact some SoC has a built-in, say USB controller does _NOT_ mean there is no more USB controllers on the same board. Some can be on PCI bus etc. The same is true for each and every other driver. And we should _NOT_ treat some drivers (e.g. SPI) as marginal. AT91RM9200 for example can _NOT_ boot off of parallel flash because of silicon error so it boots off of SPI DataFlash thus making SPI driver essential for the system.

To contain drivers is a reason for drivers/* to exist, isn't it?

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************

#53 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Quoted 66 lines · ksi at koi8.net wrote:
Quoted 34 lines · Stefan Roese
Quoted 6 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 4 lines
Quoted 4 lines
 drivers/usb/Makefile                        >        |    1 +
 .../at91/usb.c => drivers/usb/atmel_usb.c          |  >   0
 rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c

(100%)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Same here, this is architecture specific code, why move it to

generic

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

cod> e?

it's the at91 usb drivers and we need to have it in the driver/usb

Why do we need to have it in the driver/usb ?

Please explain in detail.

From what I remember we all agreed to move the device drivers (e.g.

ethernet,
NAND, USB, serial etc) from the architecture/board (cpu/... board/...) to the
drivers directories at some time.

Speaking for PPC4xx, the 4xx ethernet driver has recently been moved from
cpu/ppc4xx to drivers/net. And I'm planning to move the 4xx NAND driver (and
others) soon too.

Quoted 4 lines

So if this atmel_usb.c driver isn't just platform USB init code, but a real
USB driver, then I'm voting to move it to drivers/usb as well.

I also vote for moving _ALL_ the drivers (i2c, usb, net, etc.) to appropriate directories under drivers/ no matter architecture specific they are or not.

This will make the tree more logical and one wouldn't have to chase say USB driver all over the source tree.

Also it is a first step to general overhaul that would allow for multiple drivers support. The fact some SoC has a built-in, say USB controller does _NOT_ mean there is no more USB controllers on the same board. Some can be on PCI bus etc. The same is true for each and every other driver. And we should _NOT_ treat some drivers (e.g. SPI) as marginal. AT91RM9200 for example can _NOT_ boot off of parallel flash because of silicon error so it boots off of SPI DataFlash thus making SPI driver essential for the system.

To contain drivers is a reason for drivers/* to exist, isn't it?

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************
------------------------------------------------------------------------

Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Somenthing like that for usb?

:-----core
: :-----include
:-----device
: :-----include
:-----host
: :-----include

Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: makefile.patch
Type: text/x-patch
Size: 2040 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090401/afea2e02/attachment.bin

#54 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

Quoted 69 lines · Michael Trimarchi
Quoted 63 lines · ksi at koi8.net wrote:
Quoted 27 lines · Stefan Roese
Quoted 6 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 4 lines
Quoted 4 lines
 drivers/usb/Makefile                        >        |    1 +
 .../at91/usb.c => drivers/usb/atmel_usb.c          |  >   0
 rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c

(100%)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Same here, this is architecture specific code, why move it to

generic

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

cod> e?

it's the at91 usb drivers and we need to have it in the driver/usb

Why do we need to have it in the driver/usb ?

Please explain in detail.

From what I remember we all agreed to move the device drivers (e.g.

ethernet, NAND, USB, serial etc) from the architecture/board (cpu/... board/...)
to the drivers directories at some time.

Quoted 8 lines

Speaking for PPC4xx, the 4xx ethernet driver has recently been moved from cpu/ppc4xx to drivers/net. And I'm planning to move the 4xx NAND driver
(and others) soon too.

So if this atmel_usb.c driver isn't just platform USB init code, but a real USB driver, then I'm voting to move it to drivers/usb as well.

I also vote for moving _ALL_ the drivers (i2c, usb, net, etc.) to appropriate directories under drivers/ no matter architecture specific they are or not.

This will make the tree more logical and one wouldn't have to chase say USB driver all over the source tree.

Also it is a first step to general overhaul that would allow for multiple drivers support. The fact some SoC has a built-in, say USB controller does _NOT_ mean there is no more USB controllers on the same board. Some can be on PCI bus etc. The same is true for each and every other driver. And we should _NOT_ treat some drivers (e.g. SPI) as marginal. AT91RM9200 for example can _NOT_ boot off of parallel flash because of silicon error so it boots off of SPI DataFlash thus making SPI driver essential for the system.

To contain drivers is a reason for drivers/* to exist, isn't it?

---
******************************************************************
* KSI at home KOI8 Net < > The impossible we do immediately. *
* Las Vegas NV, USA < > Miracles require 24-hour notice. *
******************************************************************
------------------------------------------------------------------------

Quoted 5 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Quoted 8 lines

Somenthing like that for usb?

:-----core
: :-----include
:-----device
: :-----include
:-----host
: :-----include

include is a few overkill

code
host
gadget

I've in mind

Best Regards,
J.

#55 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to ksi at koi8.net
Quoted 4 lines

And we
should _NOT_ treat some drivers (e.g. SPI) as marginal. AT91RM9200 for example can _NOT_ boot off of parallel flash because of silicon error so it boots off of SPI DataFlash thus making SPI driver essential for the system.

no the RM9200 can boot from NOR Flash I do it myself maybe not on some old RM9200 rev

Best Regards,
J.

#56 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to ksi at koi8.net
Quoted 3 lines · On Wed, Apr 01, 2009 at 08:48:51AM -0700, ksi at koi8.net wrote:

I also vote for moving _ALL_ the drivers (i2c, usb, net, etc.) to appropriate directories under drivers/ no matter architecture specific they are or not.

Seconded. The criteria should generally be whether the code interacts with the subsystem (as opposed to some isolated register poking to "turn on" a common logic block), with a fair bit of deference to the developer/maintainer's intuition rather than an unyielding rule (we have enough of those in u-boot).

Quoted 2 lines

This will make the tree more logical and one wouldn't have to chase say USB driver all over the source tree.

And when someone adds a new board, they may find that their "board-specific" driver code wasn't actually as board-specific as they thought if something very similar is sitting in the same directory they need to add it to, as opposed to having 100 copies of it hidden in the directories of other boards.

Quoted 2 lines

Also it is a first step to general overhaul that would allow for multiple drivers support.

Yes. We should get away from the model of having generic code call *the* USB/NAND/SATA/whatever driver which is chosen at link time.

-Scott

#57 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to Jean-Christophe PLAGNIOL-VILLARD

Hello Jean-Christophe,

Quoted 3 lines

it's the at91 usb drivers and we need to have it in the driver/usb and it's not at91/arm926 specific but it's also shared with the at91rm9200 so I move to drivers usb

Then I can agree that the arm926 tree is not the correct place; but that does not automatically make the generic driver code the right place either...

Kind Regards,

Remy

#58 lore raw

PATCH 10/13 at91: move usb driver to drivers/usb

In reply to Remy Bohmer

Dear Remy Bohmer,

Quoted 6 lines · In message <[email protected]> you…
Quoted 4 lines

?drivers/usb/Makefile ? ? ? ? ? ? ? ? ? ? ? ? > ? ? ? | ? ?1 + ?.../at91/usb.c => drivers/usb/atmel_usb.c ? ? ? ? ?| ? > ?0 ?rename cpu/arm926ejs/at91/usb.c => drivers/usb/atmel_usb.c (100%)

Same here, this is architecture specific code, why move it to generic code?

I agree with Remy here. The modification makes no sense to me.

Please don't.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"One day," said a dull voice from down below, "I'm going to  be  back
in  form again and you're going to be very sorry you said that. For a
very long time. I might even go so far as to make even more Time just
for you to be sorry in."              - Terry Pratchett, _Small Gods_
#59 lore raw

PATCH 8/13 at91rm9200: move serial shutdown code to serial drivers

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 9 lines · In message <[email protected]> you wrote:

introduce serial_exit for this purpose. Use it only when the rm9200 serial driver is active

---
 cpu/arm920t/at91rm9200/interrupts.c |   13 +++----------
 drivers/serial/at91rm9200_usart.c   |    5 +++++
 include/common.h                    |    1 +
 3 files changed, 9 insertions(+), 10 deletions(-)

New patch version or what? No comments?

Come on, we cannot work like this.

Please learn to play by the rules.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Punishment becomes ineffective after a certain point. Men become  in-
sensitive.
	-- Eneg, "Patterns of Force", stardate 2534.7
#60 lore raw

PATCH 7/13 at91rm9200: move serial driver to drivers/serial

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 16 lines · In message <[email protected]> you wrote:

add CONFIG_AT91RM9200_USART to activate the driver

---
 cpu/arm920t/at91rm9200/Makefile                    |    2 +-
 drivers/serial/Makefile                            |    1 +
 .../serial.c => drivers/serial/at91rm9200_usart.c  |    0
 include/configs/at91rm9200dk.h                     |    1 +
 include/configs/at91rm9200ek.h                     |    1 +
 include/configs/cmc_pu2.h                          |    1 +
 include/configs/csb637.h                           |    1 +
 include/configs/kb9202.h                           |    1 +
 include/configs/m501sk.h                           |    1 +
 include/configs/mp2usb.h                           |    1 +
 10 files changed, 9 insertions(+), 1 deletions(-)
 rename cpu/arm920t/at91rm9200/serial.c => drivers/serial/at91rm9200_usart.c (100%)

What the heck is this?

A new version of the previously submitted patch?

Why do you not mark this in the subject line like "[PATCH 07/13 V2]" or similar?

Why do you not add any comment?

It is IMPOSSIBLE this way to keep track of which patch versions might be current in your patch stack.

This is a nightmare.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Motto of the Electrical Engineer: Working computer hardware is a  lot
like an erect penis: it stays up as long as you don't fuck with it.
#61 lore raw

PATCH 6/13 Add support for the AT91RM9200EK Board.

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 6 lines · On Fri, 27 Mar 2009 23:30:19 +0100 Jean-Christophe PLAGNIOL-VILLARD…
drivers/mtd/cfi_flash.c +0 -0
index 631b969..175d82a 100644
@@ -1788,13 +1788,10 @@ static void flash_fixup_atmel(flash_info_t
 *info, struct cfi_qry *qry) 

drivers/mtd/cfi_flash.c static void flash_fixup_atmel(flash_info_t · line 1797

Quoted 10 lines
drivers/mtd/cfi_flash.c +1 -4
 	/* AT49BV6416(T) list the erase regions in the wrong order.
 	 * However, the device ID is identical with the non-broken
-	 * AT49BV642D since u-boot only reads the low byte (they
-	 * differ in the high byte.) So leave out this fixup for now.
+	 * AT49BV642D they differ in the high byte.
 	 */
-#if 0
 	if (info->device_id == 0xd6 || info->device_id == 0xd2)
 		reverse_geometry = !reverse_geometry;
-#endif

Hmm...was this shortcoming actually fixed or does this change bugger up a large number of currently working boards?

Haavard