SPEAr : Adding support for SPEAr SoCs
Subsystems (6)
v3 cover SPEAr : Adding support for SPEAr SoCs
The patch set contains the review feedbacks recieved on PATCH v2 The patch set has been recreated to make sure that the dependencies do not exist. i.e all subpatches depend only on preceeding subpatches
Also removed build error which came with BUILD_DIR option
Chekckpatch error removed
Vipin (11):
SPEAr : Adding README.spear in doc
SPEAr : Adding basic support for SPEAr600
SPEAr : Adding basic support for SPEAr300
SPEAr : Adding basic support for SPEAr310
SPEAr : Adding basic support for SPEAr320
SPEAr : i2c driver support addded
SPEAr : Support for HW macid read/write from i2c memory SPEAr : Support for serial memory interface driver and serial NOR
flash
SPEAr : Support for nand driver
SPEAr : Support for usbd driver and usbtty support SPEAr : Support for cfi driver and parallel NOR flash
MAKEALL | 4 + Makefile | 6 + board/spear/common/Makefile | 54 ++ board/spear/common/spr_lowlevel_init.S | 197 +++++ board/spear/common/spr_misc.c | 297 +++++++ board/spear/spear300/Makefile | 51 ++ board/spear/spear300/config.mk | 39 + board/spear/spear300/spear300.c | 57 ++ board/spear/spear310/Makefile | 51 ++ board/spear/spear310/config.mk | 44 + board/spear/spear310/spear310.c | 58 ++ board/spear/spear320/Makefile | 51 ++ board/spear/spear320/config.mk | 44 + board/spear/spear320/spear320.c | 58 ++ board/spear/spear600/Makefile | 51 ++ board/spear/spear600/config.mk | 39 + board/spear/spear600/spear600.c | 53 ++ cpu/arm926ejs/spear/Makefile | 52 ++ cpu/arm926ejs/spear/reset.c | 53 ++ cpu/arm926ejs/spear/timer.c | 150 ++++ doc/README.spear | 53 ++ drivers/i2c/Makefile | 1 + drivers/i2c/spr_i2c.c | 340 ++++++++ drivers/mtd/Makefile | 1 + drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/spr_nand.c | 123 +++ drivers/mtd/spr_smi.c | 530 +++++++++++++ drivers/serial/usbtty.h | 2 + drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/spr_udc.c | 1004 ++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_defs.h | 38 + include/asm-arm/arch-spear/spr_emi.h | 54 ++ include/asm-arm/arch-spear/spr_gpt.h | 83 ++ include/asm-arm/arch-spear/spr_i2c.h | 146 ++++ include/asm-arm/arch-spear/spr_misc.h | 130 +++ include/asm-arm/arch-spear/spr_nand.h | 57 ++ include/asm-arm/arch-spear/spr_smi.h | 117 +++ include/asm-arm/arch-spear/spr_syscntl.h | 38 + include/asm-arm/arch-spear/spr_xloader_table.h | 67 ++ include/configs/spear.h | 363 +++++++++ include/usb/spr_udc.h | 227 ++++++ 41 files changed, 4785 insertions(+), 0 deletions(-) create mode 100644 board/spear/common/Makefile create mode 100755 board/spear/common/spr_lowlevel_init.S create mode 100755 board/spear/common/spr_misc.c create mode 100755 board/spear/spear300/Makefile create mode 100755 board/spear/spear300/config.mk create mode 100755 board/spear/spear300/spear300.c create mode 100755 board/spear/spear310/Makefile create mode 100755 board/spear/spear310/config.mk create mode 100755 board/spear/spear310/spear310.c create mode 100755 board/spear/spear320/Makefile create mode 100755 board/spear/spear320/config.mk create mode 100755 board/spear/spear320/spear320.c create mode 100755 board/spear/spear600/Makefile create mode 100755 board/spear/spear600/config.mk create mode 100755 board/spear/spear600/spear600.c create mode 100755 cpu/arm926ejs/spear/Makefile create mode 100755 cpu/arm926ejs/spear/reset.c create mode 100755 cpu/arm926ejs/spear/timer.c create mode 100644 doc/README.spear mode change 100644 => 100755 drivers/i2c/Makefile create mode 100755 drivers/i2c/spr_i2c.c mode change 100644 => 100755 drivers/mtd/Makefile create mode 100755 drivers/mtd/nand/spr_nand.c create mode 100755 drivers/mtd/spr_smi.c mode change 100644 => 100755 drivers/serial/usbtty.h mode change 100644 => 100755 drivers/usb/gadget/Makefile create mode 100755 drivers/usb/gadget/spr_udc.c create mode 100644 include/asm-arm/arch-spear/spr_defs.h create mode 100644 include/asm-arm/arch-spear/spr_emi.h create mode 100755 include/asm-arm/arch-spear/spr_gpt.h create mode 100755 include/asm-arm/arch-spear/spr_i2c.h create mode 100644 include/asm-arm/arch-spear/spr_misc.h create mode 100644 include/asm-arm/arch-spear/spr_nand.h create mode 100755 include/asm-arm/arch-spear/spr_smi.h create mode 100644 include/asm-arm/arch-spear/spr_syscntl.h create mode 100755 include/asm-arm/arch-spear/spr_xloader_table.h create mode 100755 include/configs/spear.h create mode 100755 include/usb/spr_udc.h
PATCH v3 1/11 SPEAr : Adding README.spear in doc
--- doc/README.spear | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 doc/README.spear
doc/README.spear new file +53 -0
@@ -0,0 +1,53 @@ + +SPEAr (Structured Processor Enhanced Architecture). + +SPEAr600 is also known as SPEArPlus and SPEAr300 is also known as SPEArBasic + +The SPEAr SoC family also embeds a customizable logic that could be programmed +one-time by a customer at silicon mask level (i.e. not at runtime!). +We are now adding the support in u-boot for two SoC: SPEAr600 and SPEAr3xx. +Pls note that SPEAr300/310/320 differs only for the default customization. + +All 4 SoCs share common peripherals. + +1. ARM926ejs core based (sp600 has two cores, the 2nd handled only in Linux) +2. FastEthernet (sp600 has Gbit version, but same controller - GMAC) +3. USB Host +4. USB Device +5. NAND controller (FSMC) +6. Serial NOR ctrl +7. I2C +8. SPI +9. CLCD +10. others .. + +sp600 is not customized by default. +sp3xx are differently customized... +sp300 is more oriented to TELECOM/video (it has tdm, i2s, ITU i/f support) +sp310 for networking (a part GMAC in fixed part, it has 5 MACB ctrls in +custom) +sp320 for industrial (SPP ctrl, CAN ctrl, 2 MACBs, ...) + +Everything is supported in Linux. +u-boot is not currently supporting all peripeharls (just a few). + +More description can be found on Internet, for example here: + +http://embedded-system.net/spear-basic-customizable-arm-based-soc-stmicroelectronics.html + +Build options + make spear600_config + make spear300_config + make spear310_config + make spear320_config + +Further options + make ENV=NAND (supported by all 4 SoCs) + - This option generates a uboot image that saves environment inn NAND + + make CONSOLE=USB (supported by all 4 SoCs) + - This option generates a uboot image for using usbdevice as a tty i/f + + make FLASH=PNOR (supported by SPEAr310 and SPEAr320) + - This option generates a uboot image that supports emi controller for + CFI compliant parallel NOR flash
Signature · 1 line
1.6.0.2
PATCH v3 2/11 SPEAr : Adding basic support for SPEAr600
--- MAKEALL | 1 + Makefile | 3 + board/spear/common/Makefile | 54 +++++++ board/spear/common/spr_lowlevel_init.S | 197 ++++++++++++++++++++++++ board/spear/common/spr_misc.c | 163 ++++++++++++++++++++ board/spear/spear600/Makefile | 51 ++++++ board/spear/spear600/config.mk | 28 ++++ board/spear/spear600/spear600.c | 31 ++++ cpu/arm926ejs/spear/Makefile | 52 ++++++ cpu/arm926ejs/spear/reset.c | 53 +++++++ cpu/arm926ejs/spear/timer.c | 150 ++++++++++++++++++ include/asm-arm/arch-spear/spr_defs.h | 38 +++++ include/asm-arm/arch-spear/spr_gpt.h | 83 ++++++++++ include/asm-arm/arch-spear/spr_misc.h | 130 ++++++++++++++++ include/asm-arm/arch-spear/spr_syscntl.h | 38 +++++ include/asm-arm/arch-spear/spr_xloader_table.h | 67 ++++++++ include/configs/spear.h | 149 ++++++++++++++++++ 17 files changed, 1288 insertions(+), 0 deletions(-) create mode 100644 board/spear/common/Makefile create mode 100755 board/spear/common/spr_lowlevel_init.S create mode 100755 board/spear/common/spr_misc.c create mode 100755 board/spear/spear600/Makefile create mode 100755 board/spear/spear600/config.mk create mode 100755 board/spear/spear600/spear600.c create mode 100755 cpu/arm926ejs/spear/Makefile create mode 100755 cpu/arm926ejs/spear/reset.c create mode 100755 cpu/arm926ejs/spear/timer.c create mode 100644 include/asm-arm/arch-spear/spr_defs.h create mode 100755 include/asm-arm/arch-spear/spr_gpt.h create mode 100644 include/asm-arm/arch-spear/spr_misc.h create mode 100644 include/asm-arm/arch-spear/spr_syscntl.h create mode 100755 include/asm-arm/arch-spear/spr_xloader_table.h create mode 100755 include/configs/spear.h
MAKEALL +1 -0
@@ -572,6 +572,7 @@ LIST_ARM9=" \ sheevaplug \ smdk2400 \ smdk2410 \ + spear600 \ trab \ VCMA9 \ versatile \
Makefile +3 -0
@@ -3023,6 +3023,9 @@ smdk2400_config : unconfig smdk2410_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 samsung s3c24x0 +spear600_config : unconfig + @$(MKCONFIG) -n $@ -t $(@:_config=) spear arm arm926ejs $(@:_config=) spear spear + SX1_stdout_serial_config \ SX1_config: unconfig @mkdir -p $(obj)include
board/spear/common/Makefile new file +54 -0
54 lines not on this page · raw message
board/spear/common/spr_lowlevel_init.S new file +197 -0
197 lines not on this page · raw message
board/spear/common/spr_misc.c new file +163 -0
163 lines not on this page · raw message
board/spear/spear600/Makefile new file +51 -0
51 lines not on this page · raw message
board/spear/spear600/config.mk new file +28 -0
@@ -0,0 +1,28 @@ +# +# (C) Copyright 2009 +# Vipin Kumar, ST Microelectronics <[email protected]> +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +######################################################################### + +TEXT_BASE = 0x00700000 + +ALL += $(obj)u-boot.img
board/spear/spear600/spear600.c new file +31 -0
@@ -0,0 +1,31 @@ +/* +* (C) Copyright 2009 +* Vipin Kumar, ST Micoelectronics, vipin.kumar at st.com. +* +* 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 <common.h> +#include <asm/arch/spr_defs.h> +#include <asm/arch/spr_misc.h> + +int board_init (void ) +{ +return spear_board_init (MACH_TYPE_SPEAR600 ); +}
cpu/arm926ejs/spear/Makefile new file +52 -0
52 lines not on this page · raw message
cpu/arm926ejs/spear/reset.c new file +53 -0
53 lines not on this page · raw message
cpu/arm926ejs/spear/timer.c new file +150 -0
150 lines not on this page · raw message
include/asm-arm/arch-spear/spr_defs.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* (C) Copyright 2009 +* Vipin Kumar, ST Micoelectronics, vipin.kumar at st.com. +* +* 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 +*/ + +#ifndef __SPR_DEFS_H__ +#define __SPR_DEFS_H__ + +extern int spear_board_init (ulong ); +extern void setfreq (unsigned int ,unsigned int ); +extern unsigned int setfreq_sz; + +struct chip_data { +int cpufreq; +int dramfreq; +int dramtype; +uchar version[32 ]; +}; + +#endif
include/asm-arm/arch-spear/spr_gpt.h new file +83 -0
83 lines not on this page · raw message
include/asm-arm/arch-spear/spr_misc.h new file +130 -0
130 lines not on this page · raw message
include/asm-arm/arch-spear/spr_syscntl.h new file +38 -0
@@ -0,0 +1,38 @@ +/* +* (C) Copyright 2009 +* Ryan CHEN, ST Micoelectronics, ryan.chen at st.com +* +* 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 +*/ + +struct syscntl_regs { +u32 scctrl; +u32 scsysstat; +u32 scimctrl; +u32 scimsysstat; +u32 scxtalctrl; +u32 scpllctrl; +u32 scpllfctrl; +u32 scperctrl0; +u32 scperctrl1; +u32 scperen; +u32 scperdis; +const u32 scperclken; +const u32 scperstat; +};
include/asm-arm/arch-spear/spr_xloader_table.h new file +67 -0
67 lines not on this page · raw message
include/configs/spear.h new file +149 -0
149 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH v3 3/11 SPEAr : Adding basic support for SPEAr300
--- MAKEALL | 1 + Makefile | 1 + board/spear/spear300/Makefile | 51 +++++++++++++++++++++++++++++++++++++++ board/spear/spear300/config.mk | 28 +++++++++++++++++++++ board/spear/spear300/spear300.c | 31 +++++++++++++++++++++++ include/configs/spear.h | 17 ++++++++++-- 6 files changed, 126 insertions(+), 3 deletions(-) create mode 100755 board/spear/spear300/Makefile create mode 100755 board/spear/spear300/config.mk create mode 100755 board/spear/spear300/spear300.c
MAKEALL +1 -0
@@ -572,6 +572,7 @@ LIST_ARM9=" \ sheevaplug \ smdk2400 \ smdk2410 \ + spear300 \ spear600 \ trab \ VCMA9 \
Makefile +1 -0
@@ -3023,6 +3023,7 @@ smdk2400_config : unconfig smdk2410_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 samsung s3c24x0 +spear300_config \ spear600_config : unconfig @$(MKCONFIG) -n $@ -t $(@:_config=) spear arm arm926ejs $(@:_config=) spear spear
board/spear/spear300/Makefile new file +51 -0
51 lines not on this page · raw message
board/spear/spear300/config.mk new file +28 -0
@@ -0,0 +1,28 @@ +# +# (C) Copyright 2009 +# Vipin Kumar, ST Microelectronics <[email protected]> +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +######################################################################### + +TEXT_BASE = 0x00700000 + +ALL += $(obj)u-boot.img
board/spear/spear300/spear300.c new file +31 -0
@@ -0,0 +1,31 @@ +/* +* (C) Copyright 2009 +* Vipin Kumar, ST Micoelectronics, vipin.kumar at st.com. +* +* 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 <common.h> +#include <asm/arch/spr_defs.h> +#include <asm/arch/spr_misc.h> + +int board_init (void ) +{ +return spear_board_init (MACH_TYPE_SPEAR300 ); +}
include/configs/spear.h +14 -3
@@ -28,21 +28,32 @@* High Level Configuration Options * (easy to change) */ +#if defined(CONFIG_MK_spear600)#define CONFIG_SPEAR600 1 +#elif defined(CONFIG_MK_spear300) +#define CONFIG_SPEAR3XX 1 +#define CONFIG_SPEAR300 1 +#endif /* * Serial Configuration (PL011) */ #define CONFIG_PL011_SERIAL #define CONFIG_PL011_CLOCK (48 * 1000 * 1000) -#define CONFIG_PL01x_PORTS { (void *)CONFIG_SYS_SERIAL0, \ +#define CONFIG_SYS_SERIAL0 0xD0000000 + +#if defined(CONFIG_SPEAR600 ) +#define CONFIG_SYS_SERIAL1 0xD0080000 +#define CONFIG_PL01x_PORTS {(void *)CONFIG_SYS_SERIAL0, \ (void *)CONFIG_SYS_SERIAL1 } +#elif defined(CONFIG_SPEAR300 ) +#define CONFIG_PL01x_PORTS {(void *)CONFIG_SYS_SERIAL0} +#endif +#define CONFIG_CONS_INDEX 0#define CONFIG_BAUDRATE 115200#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, \ 57600, 115200 } -#define CONFIG_SYS_SERIAL0 0xD0000000 -#define CONFIG_SYS_SERIAL1 0xD0080000#define CONFIG_SYS_LOADS_BAUD_CHANGE
Signature · 1 line
1.6.0.2
PATCH v3 4/11 SPEAr : Adding basic support for SPEAr310
--- MAKEALL | 1 + Makefile | 1 + board/spear/spear310/Makefile | 51 +++++++++++++++++++++++++++++++++++++++ board/spear/spear310/config.mk | 28 +++++++++++++++++++++ board/spear/spear310/spear310.c | 32 ++++++++++++++++++++++++ include/configs/spear.h | 33 ++++++++++++++++++++---- 6 files changed, 140 insertions(+), 6 deletions(-) create mode 100755 board/spear/spear310/Makefile create mode 100755 board/spear/spear310/config.mk create mode 100755 board/spear/spear310/spear310.c
MAKEALL +1 -0
@@ -573,6 +573,7 @@ LIST_ARM9=" \ smdk2400 \ smdk2410 \ spear300 \ + spear310 \ spear600 \ trab \ VCMA9 \
Makefile +1 -0
@@ -3024,6 +3024,7 @@ smdk2410_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm920t smdk2410 samsung s3c24x0 spear300_config \ +spear310_config \ spear600_config : unconfig @$(MKCONFIG) -n $@ -t $(@:_config=) spear arm arm926ejs $(@:_config=) spear spear
board/spear/spear310/Makefile new file +51 -0
51 lines not on this page · raw message
board/spear/spear310/config.mk new file +28 -0
@@ -0,0 +1,28 @@ +# +# (C) Copyright 2009 +# Vipin Kumar, ST Microelectronics <[email protected]> +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +######################################################################### + +TEXT_BASE = 0x00700000 + +ALL += $(obj)u-boot.img
board/spear/spear310/spear310.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* (C) Copyright 2009 +* Ryan Chen, ST Micoelectronics, ryan.chen at st.com. +* Vipin Kumar, ST Micoelectronics, vipin.kumar at st.com. +* +* 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 <common.h> +#include <asm/arch/spr_defs.h> +#include <asm/arch/spr_misc.h> + +int board_init (void ) +{ +return spear_board_init (MACH_TYPE_SPEAR300 ); +}
include/configs/spear.h +27 -6
@@ -33,6 +33,9 @@#elif defined(CONFIG_MK_spear300)#define CONFIG_SPEAR3XX 1#define CONFIG_SPEAR300 1 +#elif defined(CONFIG_MK_spear310) +#define CONFIG_SPEAR3XX 1 +#define CONFIG_SPEAR310 1#endif /*
@@ -41,6 +44,12 @@#define CONFIG_PL011_SERIAL #define CONFIG_PL011_CLOCK (48 * 1000 * 1000)#define CONFIG_SYS_SERIAL0 0xD0000000 +#define CONFIG_CONS_INDEX 0 +#define CONFIG_BAUDRATE 115200 +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, \ + 57600, 115200 } + +#define CONFIG_SYS_LOADS_BAUD_CHANGE #if defined(CONFIG_SPEAR600 )#define CONFIG_SYS_SERIAL1 0xD0080000
@@ -48,14 +57,26 @@ (void *)CONFIG_SYS_SERIAL1 }#elif defined(CONFIG_SPEAR300 )#define CONFIG_PL01x_PORTS {(void *)CONFIG_SYS_SERIAL0} -#endif -#define CONFIG_CONS_INDEX 0 -#define CONFIG_BAUDRATE 115200 -#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, \ - 57600, 115200 } +#elif defined(CONFIG_SPEAR310 ) -#define CONFIG_SYS_LOADS_BAUD_CHANGE +#if (CONFIG_CONS_INDEX ) +#undef CONFIG_PL011_CLOCK +#define CONFIG_PL011_CLOCK (83 * 1000 * 1000) +#endif + +#define CONFIG_SYS_SERIAL1 0xB2000000 +#define CONFIG_SYS_SERIAL2 0xB2080000 +#define CONFIG_SYS_SERIAL3 0xB2100000 +#define CONFIG_SYS_SERIAL4 0xB2180000 +#define CONFIG_SYS_SERIAL5 0xB2200000 +#define CONFIG_PL01x_PORTS {(void *)CONFIG_SYS_SERIAL0, \ + (void *)CONFIG_SYS_SERIAL1, \ + (void *)CONFIG_SYS_SERIAL2, \ + (void *)CONFIG_SYS_SERIAL3, \ + (void *)CONFIG_SYS_SERIAL4, \ + (void *)CONFIG_SYS_SERIAL5 } +#endif /* * Platform specific defines (SPEAr)
Signature · 1 line
1.6.0.2
PATCH v3 5/11 SPEAr : Adding basic support for SPEAr320
--- MAKEALL | 1 + Makefile | 1 + board/spear/spear320/Makefile | 51 +++++++++++++++++++++++++++++++++++++++ board/spear/spear320/config.mk | 28 +++++++++++++++++++++ board/spear/spear320/spear320.c | 32 ++++++++++++++++++++++++ include/configs/spear.h | 15 +++++++++++ 6 files changed, 128 insertions(+), 0 deletions(-) create mode 100755 board/spear/spear320/Makefile create mode 100755 board/spear/spear320/config.mk create mode 100755 board/spear/spear320/spear320.c
MAKEALL +1 -0
@@ -574,6 +574,7 @@ LIST_ARM9=" \ smdk2410 \ spear300 \ spear310 \ + spear320 \ spear600 \ trab \ VCMA9 \
Makefile +1 -0
@@ -3025,6 +3025,7 @@ smdk2410_config : unconfig spear300_config \ spear310_config \ +spear320_config \ spear600_config : unconfig @$(MKCONFIG) -n $@ -t $(@:_config=) spear arm arm926ejs $(@:_config=) spear spear
board/spear/spear320/Makefile new file +51 -0
51 lines not on this page · raw message
board/spear/spear320/config.mk new file +28 -0
@@ -0,0 +1,28 @@ +# +# (C) Copyright 2009 +# Vipin Kumar, ST Microelectronics <[email protected]> +# +# See file CREDITS for list of people who contributed to this +# project. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +######################################################################### + +TEXT_BASE = 0x00700000 + +ALL += $(obj)u-boot.img
board/spear/spear320/spear320.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* (C) Copyright 2009 +* Ryan Chen, ST Micoelectronics, ryan.chen at st.com. +* Vipin Kumar, ST Micoelectronics, vipin.kumar at st.com. +* +* 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 <common.h> +#include <asm/arch/spr_defs.h> +#include <asm/arch/spr_misc.h> + +int board_init (void ) +{ +return spear_board_init (MACH_TYPE_SPEAR300 ); +}
include/configs/spear.h +15 -0
@@ -36,6 +36,9 @@#elif defined(CONFIG_MK_spear310)#define CONFIG_SPEAR3XX 1#define CONFIG_SPEAR310 1 +#elif defined(CONFIG_MK_spear320) +#define CONFIG_SPEAR3XX 1 +#define CONFIG_SPEAR320 1#endif /*
@@ -76,6 +79,18 @@ (void *)CONFIG_SYS_SERIAL3, \ (void *)CONFIG_SYS_SERIAL4, \ (void *)CONFIG_SYS_SERIAL5 } +#elif defined(CONFIG_SPEAR320 ) + +#if (CONFIG_CONS_INDEX ) +#undef CONFIG_PL011_CLOCK +#define CONFIG_PL011_CLOCK (83 * 1000 * 1000) +#endif + +#define CONFIG_SYS_SERIAL1 0xA3000000 +#define CONFIG_SYS_SERIAL2 0xA4000000 +#define CONFIG_PL01x_PORTS {(void *)CONFIG_SYS_SERIAL0, \ + (void *)CONFIG_SYS_SERIAL1, \ + (void *)CONFIG_SYS_SERIAL2 }#endif /*
Signature · 1 line
1.6.0.2
PATCH v3 6/11 SPEAr : i2c driver support addded
--- drivers/i2c/Makefile | 1 + drivers/i2c/spr_i2c.c | 340 ++++++++++++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_i2c.h | 146 +++++++++++++++ include/configs/spear.h | 11 + 4 files changed, 498 insertions(+), 0 deletions(-) mode change 100644 => 100755 drivers/i2c/Makefile create mode 100755 drivers/i2c/spr_i2c.c create mode 100755 include/asm-arm/arch-spear/spr_i2c.h
drivers/i2c/Makefile +1 -0
@@ -37,6 +37,7 @@ COBJS-$(CONFIG_PCA9564_I2C) += pca9564_i2c.o COBJS-$(CONFIG_DRIVER_S3C24X0_I2C) += s3c24x0_i2c.o COBJS-$(CONFIG_S3C44B0_I2C) += s3c44b0_i2c.o COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o +COBJS-$(CONFIG_SPEAR_I2C) += spr_i2c.o COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o COBJS := $(COBJS-y)
drivers/i2c/spr_i2c.c new file +340 -0
340 lines not on this page · raw message
include/asm-arm/arch-spear/spr_i2c.h new file +146 -0
146 lines not on this page · raw message
include/configs/spear.h +11 -0
@@ -42,6 +42,14 @@#endif /* +* I2C driver configuration +*/ +#define CONFIG_HARD_I2C +#define CONFIG_SPEAR_I2C +#define CONFIG_SYS_I2C_SPEED 400000 +#define CONFIG_SYS_I2C_SLAVE 0x02 + +/* * Serial Configuration (PL011) */ #define CONFIG_PL011_SERIAL
@@ -100,6 +108,8 @@#define CONFIG_SPEAR_TIMERBASE (0xFC800000)#define CONFIG_SPEAR_MISCBASE (0xFCA80000) +#define CONFIG_SYS_I2C_BASE (0xD0200000) +#define CONFIG_SYS_HZ (1000)#define CONFIG_SYS_HZ_CLOCK (8300000)
@@ -128,6 +138,7 @@/* * Command support defines */ +#define CONFIG_CMD_I2C #define CONFIG_CMD_MEMORY #define CONFIG_CMD_RUN #define CONFIG_CMD_SAVES
Signature · 1 line
1.6.0.2
PATCH v3 7/11 SPEAr : Support for HW macid read/write from i2c memory
--- board/spear/common/spr_misc.c | 70 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 69 insertions(+), 1 deletions(-)
board/spear/common/spr_misc.c +69 -1
@@ -62,6 +62,13 @@ int dram_init(void)int misc_init_r (void ) { +#if defined(CONFIG_CMD_NET ) +uchar mac_id[6 ]; + +if (!eth_getenv_enetaddr ("ethaddr" , mac_id) && !i2c_read_mac (mac_id)) { +eth_setenv_enetaddr ("ethaddr" , mac_id); + } +#endif setenv ("verify" ,"n" );return 0 ; }
@@ -90,6 +97,46 @@ int spear_board_init(ulong mach_type)return 0 ; } +static int i2c_read_mac (uchar *buffer) +{ +u8 buf[2 ]; + +i2c_read (0x50 ,0x0 ,1 , buf,2 ); + +/* Check if mac in i2c memory is valid */ +if ((buf[0 ] ==0x55 ) && (buf[1 ] ==0xAA )) { +/* Valid mac address is saved in i2c eeprom */ +i2c_read (0x50 ,0x2 ,1 , buffer,6 ); +return 0 ; + } + +return -1 ; +} + +static int write_mac (uchar *mac) +{ +unsigned char buf[2 ]; + + buf[0 ] =0x55 ; + buf[1 ] =0xAA ; +i2c_write (0x50 ,0x0 ,1 , buf,2 ); + + buf[0 ] =0x44 ; + buf[1 ] =0x66 ; + +i2c_read (0x50 ,0x0 ,1 , buf,2 ); + +/* check if valid MAC address is saved in I2C EEPROM or not? */ +if ((buf[0 ] ==0x55 ) && (buf[1 ] ==0xAA )) { +i2c_write (0x50 ,0x2 ,1 , mac,6 ); +puts ("I2C EEPROM written with mac address \n" ); +return 0 ; + } + +puts ("I2C EEPROM writing failed \n" ); +return -1 ; +} +#define CPU 0#define DDR 1
@@ -97,7 +144,10 @@ int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) {void (*sram_setfreq) (unsigned int ,unsigned int );struct chip_data *chip = &chip_data; -unsigned int frequency; +unsigned char mac[6 ]; +unsigned int reg, frequency; +char *s, *e; +char i2c_mac[20 ];if ((argc >3 ) || (argc <2 )) {cmd_usage (cmdtp);
@@ -128,6 +178,17 @@ int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) }return 0 ; + }else if (!strcmp (argv[1 ],"ethaddr" )) { + + s = argv[2 ]; +for (reg =0 ; reg <6 ; ++reg) { + mac[reg] = s ?simple_strtoul (s, &e,16 ) :0 ; +if (s) + s = (*e) ? e +1 : e; + } +write_mac (mac); + +return 0 ; }else if (!strcmp (argv[1 ],"display" )) {if (chip->cpufreq ==-1 )
@@ -147,6 +208,13 @@ int do_chip_config(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])else printf ("DDR Type = Not Known\n" ); +if (!i2c_read_mac (mac)) { +sprintf (i2c_mac,"%pM" , mac); +printf ("Ethaddr (from i2c mem) = %s\n" , i2c_mac); + }else { +printf ("Ethaddr (from i2c mem) = Not set\n" ); + } +printf ("Xloader Rev = %s\n" , chip->version);return 0 ;
Signature · 1 line
1.6.0.2
PATCH v3 8/11 SPEAr : Support for serial memory interface driver and serial NOR flash
--- drivers/mtd/Makefile | 1 + drivers/mtd/spr_smi.c | 530 ++++++++++++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_smi.h | 117 ++++++++ include/configs/spear.h | 35 ++- 4 files changed, 681 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/mtd/Makefile create mode 100755 drivers/mtd/spr_smi.c create mode 100755 include/asm-arm/arch-spear/spr_smi.h
drivers/mtd/Makefile +1 -0
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o COBJS-$(CONFIG_HAS_DATAFLASH) += dataflash.o COBJS-$(CONFIG_FLASH_CFI_LEGACY) += jedec_flash.o COBJS-$(CONFIG_MW_EEPROM) += mw_eeprom.o +COBJS-$(CONFIG_SPEARSMI) += spr_smi.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c)
drivers/mtd/spr_smi.c new file +530 -0
530 lines not on this page · raw message
include/asm-arm/arch-spear/spr_smi.h new file +117 -0
117 lines not on this page · raw message
include/configs/spear.h +33 -2
@@ -50,6 +50,11 @@#define CONFIG_SYS_I2C_SLAVE 0x02/* +* SMI driver configuration +*/ +#define CONFIG_SPEARSMI + +/* * Serial Configuration (PL011) */ #define CONFIG_PL011_SERIAL
@@ -104,6 +109,8 @@/* * Platform specific defines (SPEAr) */ +#define CONFIG_SYS_SMI_BASE (0xFC000000) +#define CONFIG_SYS_FLASH_BASE (0xF8000000)#define CONFIG_SPEAR_SYSCNTLBASE (0xFCA00000)#define CONFIG_SPEAR_TIMERBASE (0xFC800000)#define CONFIG_SPEAR_MISCBASE (0xFCA80000)
@@ -134,11 +141,14 @@#define CONFIG_NAND_SPEAR 1#define CONFIG_SYS_MAX_NAND_DEVICE 1#define CONFIG_MTD_NAND_VERIFY_WRITE 1 +======= +>>>>>>> a15fb6e... SPEAr : Support for serial memory interface driver and serial NOR flash:include/configs/spear.h/* * Command support defines */#define CONFIG_CMD_I2C +#define CONFIG_CMD_ENV #define CONFIG_CMD_MEMORY #define CONFIG_CMD_RUN #define CONFIG_CMD_SAVES
@@ -155,11 +165,32 @@#define CONFIG_BOOTARGS_NFS "root=/dev/nfs ip=dhcp " \ "console=ttyS0 init=/bin/sh" +#define CONFIG_ENV_OVERWRITE +/* -* Miscellaneous configurable options +* U-Boot Environment placing definitions. */ -#define CONFIG_ENV_IS_NOWHERE 1 +#define CONFIG_ENV_IS_IN_FLASH + +#ifdef CONFIG_ENV_IS_IN_FLASH +#define CONFIG_SYS_MONITOR_LEN 0x00040000 +#define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE +#define CONFIG_ENV_SECT_SIZE 0x10000 +#define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + \ + CONFIG_SYS_MONITOR_LEN) + +#define CONFIG_BOOTARGS "console=ttyS0 mem=128M " \ + "root=/dev/mtdblock3 " \ + "rootfstype=jffs2" +#define CONFIG_BOOTCOMMAND "bootm 0xf8050000" + +#endif +#define CONFIG_ENV_SIZE 0x02000 + +/* +* Miscellaneous configurable options +*/ #define CONFIG_BOOT_PARAMS_ADDR 0x00000100#define CONFIG_CMDLINE_TAG 1#define CONFIG_SETUP_MEMORY_TAGS 1
Signature · 1 line
1.6.0.2
PATCH v3 9/11 SPEAr : Support for nand driver
--- board/spear/spear300/config.mk | 7 ++ board/spear/spear300/spear300.c | 26 +++++++ board/spear/spear310/config.mk | 7 ++ board/spear/spear310/spear310.c | 26 +++++++ board/spear/spear320/config.mk | 7 ++ board/spear/spear320/spear320.c | 26 +++++++ board/spear/spear600/config.mk | 7 ++ board/spear/spear600/spear600.c | 22 ++++++ drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/spr_nand.c | 123 +++++++++++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_nand.h | 57 +++++++++++++++ include/configs/spear.h | 59 +++++++++++++--- 12 files changed, 357 insertions(+), 11 deletions(-) create mode 100755 drivers/mtd/nand/spr_nand.c create mode 100644 include/asm-arm/arch-spear/spr_nand.h
board/spear/spear300/config.mk +7 -0
@@ -26,3 +26,10 @@ TEXT_BASE = 0x00700000 ALL += $(obj)u-boot.img + +# Environment variables in NAND +ifeq ($(ENV),NAND) +PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND +else +PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH +endif
board/spear/spear300/spear300.c +26 -0
@@ -22,10 +22,36 @@*/ #include <common.h> +#include <nand.h> +#include <asm/io.h> #include <asm/arch/spr_defs.h> #include <asm/arch/spr_misc.h> +#include <asm/arch/spr_nand.h> int board_init (void ) {return spear_board_init (MACH_TYPE_SPEAR300 ); } + +/* +* board_nand_init - Board specific NAND initialization +* @nand: mtd private chip structure +* +* Called by nand_init_chip to initialize the board specific functions +*/ + +int board_nand_init (struct nand_chip *nand) +{ +struct misc_regs *const misc_regs_p = + (struct misc_regs *)CONFIG_SPEAR_MISCBASE ; + +if (((readl (&misc_regs_p->auto_cfg_reg) &MISC_SOCCFGMSK ) == +MISC_SOCCFG30 ) || + ((readl (&misc_regs_p->auto_cfg_reg) &MISC_SOCCFGMSK ) == +MISC_SOCCFG31 )) { + +return spear_nand_init (nand); + } + +return -1 ; +}
board/spear/spear310/config.mk +7 -0
@@ -26,3 +26,10 @@ TEXT_BASE = 0x00700000 ALL += $(obj)u-boot.img + +# Environment variables in NAND +ifeq ($(ENV),NAND) +PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND +else +PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH +endif
board/spear/spear310/spear310.c +26 -0
@@ -23,10 +23,36 @@*/ #include <common.h> +#include <nand.h> +#include <asm/io.h> #include <asm/arch/spr_defs.h> #include <asm/arch/spr_misc.h> +#include <asm/arch/spr_nand.h> int board_init (void ) {return spear_board_init (MACH_TYPE_SPEAR300 ); } + +/* +* board_nand_init - Board specific NAND initialization +* @nand: mtd private chip structure +* +* Called by nand_init_chip to initialize the board specific functions +*/ + +int board_nand_init (struct nand_chip *nand) +{ +struct misc_regs *const misc_regs_p = + (struct misc_regs *)CONFIG_SPEAR_MISCBASE ; + +if (((readl (&misc_regs_p->auto_cfg_reg) &MISC_SOCCFGMSK ) == +MISC_SOCCFG30 ) || + ((readl (&misc_regs_p->auto_cfg_reg) &MISC_SOCCFGMSK ) == +MISC_SOCCFG31 )) { + +return spear_nand_init (nand); + } + +return -1 ; +}
board/spear/spear320/config.mk +7 -0
@@ -26,3 +26,10 @@ TEXT_BASE = 0x00700000 ALL += $(obj)u-boot.img + +# Environment variables in NAND +ifeq ($(ENV),NAND) +PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND +else +PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH +endif
board/spear/spear320/spear320.c +26 -0
@@ -23,10 +23,36 @@*/ #include <common.h> +#include <nand.h> +#include <asm/io.h> #include <asm/arch/spr_defs.h> #include <asm/arch/spr_misc.h> +#include <asm/arch/spr_nand.h> int board_init (void ) {return spear_board_init (MACH_TYPE_SPEAR300 ); } + +/* +* board_nand_init - Board specific NAND initialization +* @nand: mtd private chip structure +* +* Called by nand_init_chip to initialize the board specific functions +*/ + +int board_nand_init (struct nand_chip *nand) +{ +struct misc_regs *const misc_regs_p = + (struct misc_regs *)CONFIG_SPEAR_MISCBASE ; + +if (((readl (&misc_regs_p->auto_cfg_reg) &MISC_SOCCFGMSK ) == +MISC_SOCCFG30 ) || + ((readl (&misc_regs_p->auto_cfg_reg) &MISC_SOCCFGMSK ) == +MISC_SOCCFG31 )) { + +return spear_nand_init (nand); + } + +return -1 ; +}
board/spear/spear600/config.mk +7 -0
@@ -26,3 +26,10 @@ TEXT_BASE = 0x00700000 ALL += $(obj)u-boot.img + +# Environment variables in NAND +ifeq ($(ENV),NAND) +PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND +else +PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH +endif
board/spear/spear600/spear600.c +22 -0
@@ -22,10 +22,32 @@*/ #include <common.h> +#include <nand.h> +#include <asm/io.h> #include <asm/arch/spr_defs.h> #include <asm/arch/spr_misc.h> +#include <asm/arch/spr_nand.h> int board_init (void ) {return spear_board_init (MACH_TYPE_SPEAR600 ); } + +/* +* board_nand_init - Board specific NAND initialization +* @nand: mtd private chip structure +* +* Called by nand_init_chip to initialize the board specific functions +*/ + +int board_nand_init (struct nand_chip *nand) +{ +struct misc_regs *const misc_regs_p = + (struct misc_regs *)CONFIG_SPEAR_MISCBASE ; + +if (!(readl (&misc_regs_p->auto_cfg_reg) &MISC_NANDDIS )) { +return spear_nand_init (nand); + } + +return -1 ; +}
drivers/mtd/nand/Makefile +1 -0
@@ -47,6 +47,7 @@ COBJS-$(CONFIG_NAND_NDFC) += ndfc.o COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o COBJS-$(CONFIG_NAND_S3C2410) += s3c2410_nand.o COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o +COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o endif
drivers/mtd/nand/spr_nand.c new file +123 -0
123 lines not on this page · raw message
include/asm-arm/arch-spear/spr_nand.h new file +57 -0
57 lines not on this page · raw message
include/configs/spear.h +48 -11
98 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH v3 10/11 SPEAr : Support for usbd driver and usbtty support
--- board/spear/common/spr_misc.c | 6 + board/spear/spear300/config.mk | 4 + board/spear/spear310/config.mk | 9 + board/spear/spear320/config.mk | 9 + board/spear/spear600/config.mk | 4 + drivers/serial/usbtty.h | 2 + drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/spr_udc.c | 1004 ++++++++++++++++++++++++++++++++++++++++ include/configs/spear.h | 22 + include/usb/spr_udc.h | 227 +++++++++ 10 files changed, 1288 insertions(+), 0 deletions(-) mode change 100644 => 100755 drivers/serial/usbtty.h mode change 100644 => 100755 drivers/usb/gadget/Makefile create mode 100755 drivers/usb/gadget/spr_udc.c create mode 100755 include/usb/spr_udc.h
board/spear/common/spr_misc.c +6 -0
@@ -70,6 +70,12 @@ int misc_init_r(void) }#endif setenv ("verify" ,"n" ); + +#if defined(CONFIG_SPEAR_USBTTY ) +setenv ("stdin" ,"usbtty" ); +setenv ("stdout" ,"usbtty" ); +setenv ("stderr" ,"usbtty" ); +#endif return 0 ; }
board/spear/spear300/config.mk +4 -0
@@ -33,3 +33,7 @@ PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND else PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH endif + +ifeq ($(CONSOLE),USB) +PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY +endif
board/spear/spear310/config.mk +9 -0
@@ -33,3 +33,12 @@ PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND else PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH endif + +# Support parallel flash +ifeq ($(FLASH),PNOR) +PLATFORM_RELFLAGS += -DCONFIG_FLASH_PNOR +endif + +ifeq ($(CONSOLE),USB) +PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY +endif
board/spear/spear320/config.mk +9 -0
@@ -33,3 +33,12 @@ PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND else PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH endif + +# Support parallel flash +ifeq ($(FLASH),PNOR) +PLATFORM_RELFLAGS += -DCONFIG_FLASH_PNOR +endif + +ifeq ($(CONSOLE),USB) +PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY +endif
board/spear/spear600/config.mk +4 -0
@@ -33,3 +33,7 @@ PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_NAND else PLATFORM_RELFLAGS += -DCONFIG_ENV_IS_IN_FLASH endif + +ifeq ($(CONSOLE),USB) +PLATFORM_RELFLAGS += -DCONFIG_SPEAR_USBTTY +endif
drivers/serial/usbtty.h +2 -0
@@ -33,6 +33,8 @@#include <usb/musb_udc.h> #elif defined(CONFIG_PXA27X )#include <usb/pxa27x_udc.h> +#elif defined(CONFIG_SPEAR3XX ) || defined(CONFIG_SPEAR600 ) +#include <usb/spr_udc.h> #endif #include <version_autogenerated.h>
drivers/usb/gadget/Makefile +1 -0
@@ -32,6 +32,7 @@ COBJS-$(CONFIG_OMAP1510) += omap1510_udc.o COBJS-$(CONFIG_OMAP1610) += omap1510_udc.o COBJS-$(CONFIG_MPC885_FAMILY) += mpc8xx_udc.o COBJS-$(CONFIG_PXA27X) += pxa27x_udc.o +COBJS-$(CONFIG_SPEARUDC) += spr_udc.o endif COBJS := $(COBJS-y)
drivers/usb/gadget/spr_udc.c new file +1004 -0
1,004 lines not on this page · raw message
include/configs/spear.h +22 -0
@@ -42,6 +42,18 @@#endif /* +* USBD driver configuration +*/ +#define CONFIG_SPEARUDC +#define CONFIG_USB_DEVICE +#define CONFIG_USB_TTY + +#define CONFIG_USBD_PRODUCT_NAME "SPEAr SoC" +#define CONFIG_USBD_MANUFACTURER "ST Microelectronics" + +#define CONFIG_EXTRA_ENV_USBTTY "usbtty=cdc_acm\0" + +/* * I2C driver configuration */ #define CONFIG_HARD_I2C
@@ -109,6 +121,9 @@/* * Platform specific defines (SPEAr) */ +#define CONFIG_SYS_USBD_BASE (0xE1100000) +#define CONFIG_SYS_PLUG_BASE (0xE1200000) +#define CONFIG_SYS_FIFO_BASE (0xE1000800)#define CONFIG_SYS_SMI_BASE (0xFC000000)#define CONFIG_SYS_FLASH_BASE (0xF8000000)#define CONFIG_SPEAR_SYSCNTLBASE (0xFCA00000)
@@ -188,7 +203,12 @@/* * Default Environment Varible definitions */ +#if defined(CONFIG_SPEAR_USBTTY ) +#define CONFIG_BOOTDELAY -1 +#else #define CONFIG_BOOTDELAY 1 +#endif +#define CONFIG_ENV_OVERWRITE /*
@@ -255,6 +275,8 @@#define CONFIG_SYS_CONSOLE_INFO_QUIET 1#define CONFIG_SYS_64BIT_VSPRINTF 1 +#define CONFIG_EXTRA_ENV_SETTINGS CONFIG_EXTRA_ENV_USBTTY +/* * Stack sizes */
include/usb/spr_udc.h new file +227 -0
227 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH v3 11/11 SPEAr : Support for cfi driver and parallel NOR flash
--- board/spear/common/spr_misc.c | 60 +++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_emi.h | 54 ++++++++++++++++++++++ include/configs/spear.h | 82 ++++++++++++++++++++++++++++++--- 3 files changed, 188 insertions(+), 8 deletions(-) create mode 100644 include/asm-arm/arch-spear/spr_emi.h
board/spear/common/spr_misc.c +60 -0
@@ -26,6 +26,7 @@#include <i2c.h> #include <net.h> #include <asm/io.h> +#include <asm/arch/spr_emi.h> #include <asm/arch/spr_xloader_table.h> #include <asm/arch/spr_defs.h>
@@ -79,6 +80,62 @@ int misc_init_r(void)return 0 ; } +#ifdef CONFIG_SPEAR_EMI +struct cust_emi_para { +unsigned int tap; +unsigned int tsdp; +unsigned int tdpw; +unsigned int tdpr; +unsigned int tdcs; +unsigned int control; +}; + +/* EMI timing setting of m28w640hc of linux kernel */ +const struct cust_emi_para emi_timing_m28w640hc = { + .tap =0x10 , + .tsdp =0x05 , + .tdpw =0x0a , + .tdpr =0x0a , + .tdcs =0x05 , +}; + +/* EMI timing setting of bootrom */ +const struct cust_emi_para emi_timing_bootrom = { + .tap =0xf , + .tsdp =0x0 , + .tdpw =0xff , + .tdpr =0x111 , + .tdcs =0x02 , +}; + +void spear_emi_init (void ) +{ +const struct cust_emi_para *p = &emi_timing_m28w640hc; +struct emi_regs *emi_regs_p = (struct emi_regs *)CONFIG_SPEAR_EMIBASE ; +unsigned int cs; +unsigned int val, tmp; + + val =readl (CONFIG_SPEAR_RASBASE ); + +if (val &EMI_ACKMSK ) + tmp =0x3f ; +else + tmp =0x0 ; + +writel (tmp, &emi_regs_p->ack); + +for (cs =0 ; cs <CONFIG_SYS_MAX_FLASH_BANKS ; cs++) { +writel (p->tap, &emi_regs_p->bank_regs[cs].tap); +writel (p->tsdp, &emi_regs_p->bank_regs[cs].tsdp); +writel (p->tdpw, &emi_regs_p->bank_regs[cs].tdpw); +writel (p->tdpr, &emi_regs_p->bank_regs[cs].tdpr); +writel (p->tdcs, &emi_regs_p->bank_regs[cs].tdcs); +writel (EMI_CNTL_ENBBYTERW | ((val &0x18 ) >>3 ), + &emi_regs_p->bank_regs[cs].control); + } +} +#endif +int spear_board_init (ulong mach_type) { struct xloader_table *xloader_tb =
@@ -100,6 +157,9 @@ int spear_board_init(ulong mach_type) sizeof(chip->version)); } +#ifdef CONFIG_SPEAR_EMI +spear_emi_init (); +#endif return 0 ; }
include/asm-arm/arch-spear/spr_emi.h new file +54 -0
54 lines not on this page · raw message
include/configs/spear.h +74 -8
137 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH v3 6/11 SPEAr : i2c driver support addded
In reply to Vipin KUMARHello Vipin,
Quoted 11 lines · Vipin KUMAR
Signed-off-by Vipin <[email protected]>--- drivers/i2c/Makefile | 1 + drivers/i2c/spr_i2c.c | 340 ++++++++++++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_i2c.h | 146 +++++++++++++++ include/configs/spear.h | 11 + 4 files changed, 498 insertions(+), 0 deletions(-) mode change 100644 => 100755 drivers/i2c/Makefile create mode 100755 drivers/i2c/spr_i2c.c create mode 100755 include/asm-arm/arch-spear/spr_i2c.h
[...]
Quoted 5 lines
drivers/i2c/spr_i2c.c new file +0
-0
[...]
drivers/i2c/spr_i2c.c line 84
Quoted 10 lines
drivers/i2c/spr_i2c.c new file +10
-0+/* +* i2c_set_bus_speed - Set the i2c speed +* @speed: required i2c speed +* +* Set the i2c speed. +*/ +void i2c_set_bus_speed (int speed) +{ +if (speed >=I2C_MAX_SPEED ) { +set_speed (IC_SPEED_MODE_MAX );
No brackets for single statement, please,
Quoted 1 line
+
blank line not needed here.
drivers/i2c/spr_i2c.c line 88
Quoted 3 lines
drivers/i2c/spr_i2c.c new file +3
-0+ }else if (speed >=I2C_FAST_SPEED ) { +set_speed (IC_SPEED_MODE_FAST ); +
same as above.
Quoted 9 lines
drivers/i2c/spr_i2c.c new file +9
-0+ }else { +set_speed (IC_SPEED_MODE_STANDARD ); + } +} + +/* +* i2c_get_bus_speed - Gets the i2c speed +* +* Gets the i2c speed.
drivers/i2c/spr_i2c.c line 107
Quoted 10 lines
drivers/i2c/spr_i2c.c new file +10
-0+*/ +int i2c_get_bus_speed (void ) +{ +u32 cntl; + + cntl = (readl (&i2c_regs_p->ic_con) &IC_CON_SPD_MSK ); + +if (cntl ==IC_CON_SPD_HS ) { +return I2C_MAX_SPEED ; +
here too, please fix globally.
[...]
If you fix this small Coding Style issues, you get my:
thanks!
bye
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany