at91sam9/at91cap: spi init add hardware chip select support
Subsystems (13)
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -0,0 +1,5 @@ +# +# Generated files +# + +/u-boot.lds
include/at45.h +1 -1
@@ -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
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
@@ -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
@@ -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
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
@@ -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
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
@@ -570,6 +570,7 @@ LIST_at91=" \ afeb9260 \ at91cap9adk \ at91rm9200dk \ + at91rm9200ek \ at91sam9260ek \ at91sam9261ek \ at91sam9263ek \
Makefile +3 -0
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
include/configs/at91rm9200dk.h +1 -0
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
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
@@ -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
@@ -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
include/configs/afeb9260.h +1 -0
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
include/configs/afeb9260.h +1 -0
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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
@@ -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
PATCH 13/13 at91sam9263ek: active hush and auto compelete support
Dear Jean-Christophe PLAGNIOL-VILLARD,
Quoted 10 lines · In message <[email protected]> you wrote:
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- include/configs/at91sam9263ek.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)include/configs/at91sam9263ek.h +0
-0
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
PATCH 13/13 at91sam9263ek: active hush and auto compelete support
Quoted 11 lines · Wolfgang Denk
include/configs/at91sam9263ek.h line 209
Quoted 4 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>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]>
PATCH 12/13 at91: add hardware i2c drivers
In reply to Jean-Christophe PLAGNIOL-VILLARDHello Jean,
Quoted 24 lines · Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- 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@@ -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@@ -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@@ -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
PATCH 12/13 at91: add hardware i2c drivers
Quoted 36 lines · Heiko Schocher
Hello Jean,
Quoted 24 lines · Jean-Christophe PLAGNIOL-VILLARD
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- 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@@ -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.oIndependent 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_I2CWhy not "#if
defined(CONFIG_I2C_ATMEL)" as in theMakefile?
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; +#endifplease 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; +#endifhere 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@@ -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.
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
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- 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@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk LIB := $(obj)libi2c.aQuoted 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.oIndependent 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 theKconfigpatch 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_I2CWhy not "#if
defined(CONFIG_I2C_ATMEL)" as in theMakefile?until the
KconfigI'll prefer to keep theCONFIG_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@@ -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
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.
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
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.
PATCH 12/13 at91: add hardware i2c drivers
In reply to Heiko SchocherDear 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_I2CWhy not "#if
defined(CONFIG_I2C_ATMEL)" as in theMakefile?
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.
PATCH 12/13 at91: add hardware i2c drivers
In reply to Jean-Christophe PLAGNIOL-VILLARDDear Jean-Christophe,
Quoted 14 lines · On Friday 27 March 2009 23:30 you wrote:
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- 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
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to Jean-Christophe PLAGNIOL-VILLARDHello,
Quoted 3 lines
?drivers/usb/Makefile ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ?1 + ?.../at91/usb.c =>
drivers/usb/atmel_usb.c? ? ? ? ?| ? ?0 ?renamecpu/arm926ejs/at91/usb.c=>drivers/usb/atmel_usb.c(100%)
Same here, this is architecture specific code, why move it to generic code?
Remy
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 ?renamecpu/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.
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 ?renamecpu/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
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 ?renamecpu/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.
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to Wolfgang DenkQuoted 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 ?renamecpu/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
=====================================================================
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.cdriver isn't just platform USB init code, but a real USB driver, then I'm voting to move it todrivers/usbas 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
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.cdriver isn't just platform USB init code, but a real USB driver, then I'm voting to move it todrivers/usbas 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.
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
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.
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
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to Remy BohmerQuoted 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 heredrivers/usb/host/ohci-at91.c
Best Regards,
J.
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
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
=====================================================================
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.
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
=====================================================================
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
drivers/usb/host/davinci_usb.h renamed from drivers/usb/davinci_usb.h +0 -0
drivers/usb/host/isp116x-hcd.c renamed from drivers/usb/isp116x-hcd.c +0 -0
drivers/usb/host/isp116x.h renamed from drivers/usb/isp116x.h +0 -0
drivers/usb/host/musb_core.c renamed from drivers/usb/musb_core.c +0 -0
drivers/usb/host/musb_core.h renamed from drivers/usb/musb_core.h +0 -0
drivers/usb/host/musb_hcd.c renamed from drivers/usb/musb_hcd.c +0 -0
drivers/usb/host/musb_hcd.h renamed from drivers/usb/musb_hcd.h +0 -0
drivers/usb/host/r8a66597-hcd.c renamed from drivers/usb/r8a66597-hcd.c +0 -0
drivers/usb/host/r8a66597.h renamed from drivers/usb/r8a66597.h +0 -0
drivers/usb/host/sl811.h renamed from drivers/usb/sl811.h +0 -0
drivers/usb/host/sl811_usb.c renamed from drivers/usb/sl811_usb.c +1 -1
@@ -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
@@ -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
drivers/usb/host/usb_ehci_ixp.c renamed from drivers/usb/usb_ehci_ixp.c +2 -2
@@ -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
@@ -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
@@ -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
include/usb_ehci_core.h renamed from drivers/usb/usb_ehci_core.h +0 -0
include/usb_ohci.h renamed from drivers/usb/usb_ohci.h +0 -0
Signature · 1 line
1.6.1.3
RFC PATCH 1/1 drivers/usb: regorganisation
Dear Jean-Christophe PLAGNIOL-VILLARD,
Quoted 3 lines · In message <[email protected]> you wrote:
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>---
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 | 0usb_[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_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:
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>---
better description will be wrote for the final patchMaybe 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.
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
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +5 -4
@@ -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
@@ -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
@@ -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
drivers/usb/host/ehci-fsl.c renamed from drivers/usb/usb_ehci_fsl.c +3 -3
@@ -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
drivers/usb/host/ehci-hcd.c renamed from drivers/usb/usb_ehci_core.c +2 -1
@@ -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
@@ -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
@@ -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
@@ -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
drivers/usb/host/isp116x-hcd.c renamed from drivers/usb/isp116x-hcd.c +0 -0
drivers/usb/host/isp116x.h renamed from drivers/usb/isp116x.h +0 -0
drivers/usb/host/ohci-hcd.c renamed from drivers/usb/usb_ohci.c +2 -1
@@ -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
drivers/usb/host/r8a66597-hcd.c renamed from drivers/usb/r8a66597-hcd.c +0 -0
drivers/usb/host/r8a66597.h renamed from drivers/usb/r8a66597.h +0 -0
drivers/usb/host/s3c64xx-hcd.c renamed from drivers/usb/s3c64xx_usb.c +0 -0
drivers/usb/host/sl811-hcd.c renamed from drivers/usb/sl811_usb.c +1 -1
@@ -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
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
@@ -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
drivers/usb/musb/musb_core.c renamed from drivers/usb/musb_core.c +0 -0
drivers/usb/musb/musb_core.h renamed from drivers/usb/musb_core.h +0 -0
drivers/usb/musb/musb_hcd.c renamed from drivers/usb/musb_hcd.c +0 -0
drivers/usb/musb/musb_hcd.h renamed from drivers/usb/musb_hcd.h +0 -0
include/usb/mpc8xx_udc.h renamed from include/usbdcore_mpc8xx.h +0 -0
include/usb/omap1510_udc.h renamed from include/usbdcore_omap1510.h +0 -0
include/usbdevice.h renamed from include/usbdcore.h +0 -0
Signature · 1 line
1.6.1.3
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
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Remy Bohmer <[email protected]>---
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@@ -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 100644drivers/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
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
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Remy Bohmer <[email protected]>---
Remy is this one ok for you?Looks OK to me, but..
Quoted 8 lines
drivers/serial/usbtty.c +0
-0@@ -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.cbe? 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 100644drivers/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.
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."
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.
PATCH 1/1 drivers/usb: regorganisation
In reply to Wolfgang Denkmove to linux usb driver organisation
as following
drivers/usb/gadgetdrivers/usb/hostdrivers/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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +5 -4
@@ -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
@@ -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
@@ -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
drivers/usb/host/ehci-fsl.c renamed from drivers/usb/usb_ehci_fsl.c +3 -3
@@ -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
drivers/usb/host/ehci-hcd.c renamed from drivers/usb/usb_ehci_core.c +2 -1
@@ -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
@@ -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
@@ -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
@@ -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
drivers/usb/host/isp116x-hcd.c renamed from drivers/usb/isp116x-hcd.c +0 -0
drivers/usb/host/isp116x.h renamed from drivers/usb/isp116x.h +0 -0
drivers/usb/host/ohci-at91.c renamed from drivers/usb/atmel_usb.c +0 -0
drivers/usb/host/ohci-hcd.c renamed from drivers/usb/usb_ohci.c +2 -1
@@ -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
drivers/usb/host/r8a66597-hcd.c renamed from drivers/usb/r8a66597-hcd.c +0 -0
drivers/usb/host/r8a66597.h renamed from drivers/usb/r8a66597.h +0 -0
drivers/usb/host/s3c64xx-hcd.c renamed from drivers/usb/s3c64xx_usb.c +0 -0
drivers/usb/host/sl811-hcd.c renamed from drivers/usb/sl811_usb.c +1 -1
@@ -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
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
@@ -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
drivers/usb/musb/musb_core.c renamed from drivers/usb/musb_core.c +0 -0
drivers/usb/musb/musb_core.h renamed from drivers/usb/musb_core.h +0 -0
drivers/usb/musb/musb_hcd.c renamed from drivers/usb/musb_hcd.c +0 -0
drivers/usb/musb/musb_hcd.h renamed from drivers/usb/musb_hcd.h +0 -0
include/usb/mpc8xx_udc.h renamed from include/usbdcore_mpc8xx.h +0 -0
include/usb/omap1510_udc.h renamed from include/usbdcore_omap1510.h +0 -0
include/usbdevice.h renamed from include/usbdcore.h +0 -0
Signature · 1 line
1.6.1.3
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/gadgetdrivers/usb/hostdrivers/usb/musb
Quoted 7 lines
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>Cc Remy Bohmer <[email protected]>---
Hi Remy,
This version containt everyone ask
and is based on the AT91 tree
which contain the patch that move the at91 usb todrivers/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(-)
?copydrivers/usb/{=> gadget}/Makefile (60%)
?renamedrivers/usb/{usbdcore.c=>gadget/core.c} (99%) ?renamedrivers/usb/{usbdcore_ep0.c=>gadget/ep0.c} (99%) ?renameinclude/usbdcore_ep0.h=>drivers/usb/gadget/ep0.h(100%) ?renamedrivers/usb/{usbdcore_mpc8xx.c=>gadget/mpc8xx_udc.c} (99%) ?renamedrivers/usb/{usbdcore_omap1510.c=>gadget/omap1510_udc.c} (99%) ?renamedrivers/usb/{=> host}/Makefile (64%)
?renamedrivers/usb/{usb_ehci_core.h=>host/ehci-core.h} (100%) ?renamedrivers/usb/{usb_ehci_fsl.c=>host/ehci-fsl.c} (97%) ?renamedrivers/usb/{usb_ehci_fsl.h=>host/ehci-fsl.h} (100%) ?renamedrivers/usb/{usb_ehci_core.c=>host/ehci-hcd.c} (99%) ?renamedrivers/usb/{usb_ehci_ixp.c=>host/ehci-ixp4xx.c} (96%) ?renamedrivers/usb/{usb_ehci_pci.c=>host/ehci-pci.c} (97%) ?renamedrivers/usb/{usb_ehci_vct.c=>host/ehci-vct.c} (96%) ?renamedrivers/usb/{usb_ehci.h=>host/ehci.h} (100%) ?renamedrivers/usb/{=>host}/isp116x-hcd.c(100%)
?renamedrivers/usb/{=>host}/isp116x.h(100%)
?renamedrivers/usb/{atmel_usb.c=>host/ohci-at91.c} (100%) ?renamedrivers/usb/{usb_ohci.c=>host/ohci-hcd.c} (99%) ?renamedrivers/usb/{usb_ohci.h=>host/ohci.h} (100%) ?renamedrivers/usb/{=>host}/r8a66597-hcd.c(100%)
?renamedrivers/usb/{=>host}/r8a66597.h(100%)
?renamedrivers/usb/{s3c64xx_usb.c=>host/s3c64xx-hcd.c} (100%) ?renamedrivers/usb/{sl811_usb.c=>host/sl811-hcd.c} (99%) ?renamedrivers/usb/{=>host}/sl811.h(100%)
?create mode 100644drivers/usb/musb/Makefile
?renamedrivers/usb/{davinci_usb.c=>musb/davinci.c} (99%) ?renamedrivers/usb/{davinci_usb.h=>musb/davinci.h} (100%) ?renamedrivers/usb/{=>musb}/musb_core.c(100%)
?renamedrivers/usb/{=>musb}/musb_core.h(100%)
?renamedrivers/usb/{=>musb}/musb_hcd.c(100%)
?renamedrivers/usb/{=>musb}/musb_hcd.h(100%)
?renameinclude/{usbdcore_mpc8xx.h=>usb/mpc8xx_udc.h} (100%) ?renameinclude/{usbdcore_omap1510.h=>usb/omap1510_udc.h} (100%) ?renameinclude/{usbdcore.h=>usbdevice.h} (100%)Makefile +0
-0@@ -263,7 +263,9 @@ endif?LIBS +=
drivers/rtc/librtc.a
?LIBS +=drivers/serial/libserial.a
?LIBS +=drivers/twserial/libtws.aMakefile +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.adrivers/serial/usbtty.c +0
-0@@ -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@@ -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@@ -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_DEVICEdrivers/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@@ -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_INTERFACES2drivers/usb/gadget/ep0.c renamed from drivers/usb/usbdcore_ep0.c +0
-0@@ -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
?#definedbg_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
-0drivers/usb/gadget/mpc8xx_udc.c renamed from drivers/usb/usbdcore_mpc8xx.c +0
-0@@ -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 modifydrivers/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@@ -31,10 +31,10 @@?#ifdef
CONFIG_OMAP_SX1
?#include <i2c.h>
?#endifdrivers/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@@ -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
-0drivers/usb/host/ehci-fsl.c renamed from drivers/usb/usb_ehci_fsl.c +0
-0@@ -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 managedrivers/usb/host/ehci-fsl.h renamed from drivers/usb/usb_ehci_fsl.h +0
-0drivers/usb/host/ehci-hcd.c renamed from drivers/usb/usb_ehci_core.c +0
-0@@ -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;
?structehci_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@@ -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@@ -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 structpci_device_idehci_pci_ids[] = {drivers/usb/host/ehci-vct.c renamed from drivers/usb/usb_ehci_vct.c +0
-0@@ -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
-0drivers/usb/host/isp116x-hcd.c renamed from drivers/usb/isp116x-hcd.c +0
-0drivers/usb/host/isp116x.h renamed from drivers/usb/isp116x.h +0
-0drivers/usb/host/ohci-at91.c renamed from drivers/usb/atmel_usb.c +0
-0drivers/usb/host/ohci-hcd.c renamed from drivers/usb/usb_ohci.c +0
-0@@ -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 forAT91_USB_HOST_BASE*/drivers/usb/host/ohci.h renamed from drivers/usb/usb_ohci.h +0
-0drivers/usb/host/r8a66597-hcd.c renamed from drivers/usb/r8a66597-hcd.c +0
-0drivers/usb/host/r8a66597.h renamed from drivers/usb/r8a66597.h +0
-0drivers/usb/host/s3c64xx-hcd.c renamed from drivers/usb/s3c64xx_usb.c +0
-0drivers/usb/host/sl811-hcd.c renamed from drivers/usb/sl811_usb.c +0
-0@@ -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
-0drivers/usb/musb/Makefile new file +47
-0@@ -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@@ -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 */
?structmusb_configmusb_cfg= {drivers/usb/musb/davinci.h renamed from drivers/usb/davinci_usb.h +0
-0drivers/usb/musb/musb_core.c renamed from drivers/usb/musb_core.c +0
-0drivers/usb/musb/musb_core.h renamed from drivers/usb/musb_core.h +0
-0drivers/usb/musb/musb_hcd.c renamed from drivers/usb/musb_hcd.c +0
-0drivers/usb/musb/musb_hcd.h renamed from drivers/usb/musb_hcd.h +0
-0include/usb/mpc8xx_udc.h renamed from include/usbdcore_mpc8xx.h +0
-0include/usb/omap1510_udc.h renamed from include/usbdcore_omap1510.h +0
-0include/usbdevice.h renamed from include/usbdcore.h +0
-1--1.6.1.3
RFC PATCH 1/1 drivers/usb: regorganisation
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 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
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to Stefan RoeseQuoted 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 thehost.
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. *
******************************************************************
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to Remy BohmerQuoted 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 NANDdriver (and
Quoted 3 lines
others) soon too.
So if this
atmel_usb.cdriver 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/usbas 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. *
******************************************************************
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to Stefan RoeseQuoted 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 ?renamecpu/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 todrivers/net. And I'm planning to move the 4xx NAND driver (and
others) soon too.
Quoted 3 lines
So if this
atmel_usb.cdriver isn't just platform USB init code, but a real
USB driver, then I'm voting to move it todrivers/usbas 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. *
******************************************************************
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 todrivers/net. And I'm planning to move the 4xx NAND driver (and
others) soon too.Quoted 4 lines
So if this
atmel_usb.cdriver isn't just platform USB init code, but a real
USB driver, then I'm voting to move it todrivers/usbas 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
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.cdriver isn't just platform USB init code, but a real USB driver, then I'm voting to move it todrivers/usbas 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.
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to ksi at koi8.netQuoted 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.
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to ksi at koi8.netQuoted 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
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to Jean-Christophe PLAGNIOL-VILLARDHello 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
PATCH 10/13 at91: move usb driver to drivers/usb
In reply to Remy BohmerDear 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 ?renamecpu/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_
PATCH 8/13 at91rm9200: move serial shutdown code to serial drivers
In reply to Jean-Christophe PLAGNIOL-VILLARDDear Jean-Christophe PLAGNIOL-VILLARD,
Quoted 9 lines · In message <[email protected]> you wrote:
introduce
serial_exitfor this purpose. Use it only when the rm9200 serial driver is activeSigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- 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
PATCH 7/13 at91rm9200: move serial driver to drivers/serial
In reply to Jean-Christophe PLAGNIOL-VILLARDDear Jean-Christophe PLAGNIOL-VILLARD,
Quoted 16 lines · In message <[email protected]> you wrote:
add
CONFIG_AT91RM9200_USARTto activate the driverSigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>--- 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.
PATCH 6/13 Add support for the AT91RM9200EK Board.
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 6 lines · On Fri, 27 Mar 2009 23:30:19 +0100 Jean-Christophe PLAGNIOL-VILLARD…
drivers/mtd/cfi_flash.c +0
-0@@ -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