Support for SPEAr SoCs
Subsystems (6)
v4 cover Support for SPEAr SoCs
This is patch set version 4 for SPEAr SoC support Modifications:
1. patch set reordered to add SPEAr arch, drivers and then board support
2. checkpatch warnings and errors removed
Vipin (12):
SPEAr : Adding README.spear in doc
SPEAr : Adding basic SPEAr architecture support. SPEAr : i2c driver support added for SPEAr SoCs SPEAr : smi driver support for SPEAr SoCs
SPEAr : nand driver support for SPEAr SoCs
SPEAr : usbd driver support for SPEAr SoCs
SPEAr : Support added for SPEAr600 board
SPEAr : Support for HW mac id read/write from i2c mem SPEAr : Support added for SPEAr300 board
SPEAr : emi controller initialization for CFI driver support SPEAr : Support added for SPEAr310 board
SPEAr : Support added for SPEAr320 board
MAKEALL | 4 + Makefile | 6 + board/spear/common/Makefile | 54 ++ board/spear/common/spr_lowlevel_init.S | 197 +++++ board/spear/common/spr_misc.c | 296 +++++++ 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 | 52 ++ 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 | 330 ++++++++ drivers/mtd/Makefile | 1 + drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/spr_nand.c | 123 +++ drivers/mtd/spr_smi.c | 529 +++++++++++++ drivers/serial/usbtty.h | 2 + drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/spr_udc.c | 1002 ++++++++++++++++++++++++ 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, 4770 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 v4 1/12 SPEAr : Adding README.spear in doc
README.spear contains information about SPEAr architecture and build options etc
--- 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 v4 2/12 SPEAr : Adding basic SPEAr architecture support.
SPEAr Architecture support added. It contains the support for following SPEAr blocks
- Timer
- System controller
- Misc registers
--- cpu/arm926ejs/spear/Makefile | 52 ++++++++++ cpu/arm926ejs/spear/reset.c | 53 +++++++++++ cpu/arm926ejs/spear/timer.c | 150 ++++++++++++++++++++++++++++++ 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 ++++++++ 6 files changed, 506 insertions(+), 0 deletions(-) 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 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
cpu/arm926ejs/spear/Makefile new file +52 -0
@@ -0,0 +1,52 @@ +# +# (C) Copyright 2000-2006 +# 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)lib$(SOC).a + +COBJS := reset.o \ + timer.o +SOBJS := + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB): $(obj).depend $(OBJS) $(SOBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
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_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; +};
Signature · 1 line
1.6.0.2
PATCH v4 3/12 SPEAr : i2c driver support added for SPEAr SoCs
SPEAr SoCs contain a synopsys i2c controller.
This patch adds the driver for this IP.
--- drivers/i2c/Makefile | 1 + drivers/i2c/spr_i2c.c | 330 ++++++++++++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_i2c.h | 146 +++++++++++++++ 3 files changed, 477 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 +330 -0
330 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
Signature · 1 line
1.6.0.2
PATCH v4 4/12 SPEAr : smi driver support for SPEAr SoCs
SPEAr SoCs contain a serial memory interface controller. This controller is used to interface with spi based memories. This patch adds the driver for this IP.
--- drivers/mtd/Makefile | 1 + drivers/mtd/spr_smi.c | 529 ++++++++++++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_smi.h | 117 ++++++++ 3 files changed, 647 insertions(+), 0 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 +529 -0
529 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
Signature · 1 line
1.6.0.2
PATCH v4 5/12 SPEAr : nand driver support for SPEAr SoCs
SPEAr SoCs contain an FSMC controller which can be used to interface with a range of memories eg. NAND, SRAM, NOR.
Currently, this driver supports interfacing FSMC with NAND memories
--- drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/spr_nand.c | 123 +++++++++++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_nand.h | 57 +++++++++++++++ 3 files changed, 181 insertions(+), 0 deletions(-) create mode 100755 drivers/mtd/nand/spr_nand.c create mode 100644 include/asm-arm/arch-spear/spr_nand.h
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
Signature · 1 line
1.6.0.2
PATCH v4 6/12 SPEAr : usbd driver support for SPEAr SoCs
SPEAr SoCs contain a synopsys usb device controller. USB Device IP can work in 2 modes
- DMA mode
- Slave mode
The driver adds support only for slave mode operation of usb device IP. This driver is used along with standard USBTTY driver to obtain a tty interface over USB on the host
--- drivers/serial/usbtty.h | 2 + drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/spr_udc.c | 1002 ++++++++++++++++++++++++++++++++++++++++++ include/usb/spr_udc.h | 227 ++++++++++ 4 files changed, 1232 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
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 +1002 -0
1,002 lines not on this page · raw message
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 v4 7/12 SPEAr : Support added for SPEAr600 board
SPEAr600 SoC support contains basic spear600 support along with the usage of following drivers
- serial driver
- i2c driver
- smi driver
- nand driver
- usbd driver
--- MAKEALL | 1 + Makefile | 3 + board/spear/common/Makefile | 54 +++++ board/spear/common/spr_lowlevel_init.S | 197 +++++++++++++++++++ board/spear/common/spr_misc.c | 169 ++++++++++++++++ board/spear/spear600/Makefile | 51 +++++ board/spear/spear600/config.mk | 39 ++++ board/spear/spear600/spear600.c | 52 +++++ include/asm-arm/arch-spear/spr_defs.h | 38 ++++ include/asm-arm/arch-spear/spr_xloader_table.h | 67 +++++++ include/configs/spear.h | 251 ++++++++++++++++++++++++ 11 files changed, 922 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 100644 include/asm-arm/arch-spear/spr_defs.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 +169 -0
169 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 +39 -0
@@ -0,0 +1,39 @@ +# +# (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 + +# Environment variables in NAND +ifeq ($(ENV),NAND) +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/spear600/spear600.c new file +52 -0
52 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_xloader_table.h new file +67 -0
67 lines not on this page · raw message
include/configs/spear.h new file +251 -0
251 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH v4 8/12 SPEAr : Support for HW mac id read/write from i2c mem
This patch adds the support to read and write mac id from i2c memory.
For reading:
if (env contains ethaddr)
pick env ethaddr
else
pick ethaddr from i2c memory
For writing:
chip_config ethaddr XX:XX:XX:XX:XX:XX writes the mac id in i2c memory
--- board/spear/common/spr_misc.c | 69 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 68 insertions(+), 1 deletions(-)
board/spear/common/spr_misc.c +68 -1
@@ -62,6 +62,12 @@ 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" );#if defined(CONFIG_SPEAR_USBTTY )
@@ -96,6 +102,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
@@ -103,7 +149,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);
@@ -134,6 +183,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 )
@@ -153,6 +213,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 v4 9/12 SPEAr : Support added for SPEAr300 board
SPEAr300 SoC support contains basic spear300 support along with the usage of following drivers
- serial driver(UART)
- i2c driver
- smi driver
- nand driver(FSMC)
- usbd driver
--- MAKEALL | 1 + Makefile | 1 + board/spear/spear300/Makefile | 51 ++++++++++++++++++++++++++++++++++ board/spear/spear300/config.mk | 39 ++++++++++++++++++++++++++ board/spear/spear300/spear300.c | 57 +++++++++++++++++++++++++++++++++++++++ include/configs/spear.h | 25 +++++++++++++++-- 6 files changed, 171 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 +39 -0
@@ -0,0 +1,39 @@ +# +# (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 + +# Environment variables in NAND +ifeq ($(ENV),NAND) +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/spear300/spear300.c new file +57 -0
57 lines not on this page · raw message
include/configs/spear.h +22 -3
@@ -28,7 +28,12 @@* 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 /* * USBD driver configuration
@@ -64,14 +69,20 @@*/ #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
@@ -89,10 +100,18 @@#define CONFIG_SYS_NAND_CLE (1 << 16)#define CONFIG_SYS_NAND_ALE (1 << 17) +#if defined(CONFIG_SPEAR600 )#define CONFIG_SYS_I2C_BASE (0xD0200000)#define CONFIG_SPEAR_FSMCBASE (0xD1800000)#define CONFIG_SYS_NAND_BASE (0xD2000000) +#elif defined(CONFIG_SPEAR300 ) +#define CONFIG_SYS_I2C_BASE (0xD0180000) +#define CONFIG_SPEAR_FSMCBASE (0x94000000) +#define CONFIG_SYS_NAND_BASE (0x80000000) + +#endif +#define CONFIG_SYS_HZ (1000)#define CONFIG_SYS_HZ_CLOCK (8300000)
Signature · 1 line
1.6.0.2
PATCH v4 10/12 SPEAr : emi controller initialization for CFI driver support
SPEAr310 and SPEAr320 SoCs contain an EMI controller to interface Paraller NOR flashes. This patch adds the support for this IP
The standard CFI driver is used to interface with NOR flashes
--- board/spear/common/spr_misc.c | 60 ++++++++++++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_emi.h | 54 ++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 0 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>
@@ -78,6 +79,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 =
@@ -99,6 +156,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
Signature · 1 line
1.6.0.2
PATCH v4 11/12 SPEAr : Support added for SPEAr310 board
SPEAr310 SoC support contains basic spear310 support along with the usage of following drivers
- serial driver(UART)
- i2c driver
- smi driver
- nand driver(FSMC)
- usbd driver
- emi driver(cfi support)
--- MAKEALL | 1 + Makefile | 1 + board/spear/spear310/Makefile | 51 +++++++++++++++++++++++++ board/spear/spear310/config.mk | 44 +++++++++++++++++++++ board/spear/spear310/spear310.c | 58 ++++++++++++++++++++++++++++ include/configs/spear.h | 79 ++++++++++++++++++++++++++++++++++++--- 6 files changed, 228 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 +44 -0
44 lines not on this page · raw message
board/spear/spear310/spear310.c new file +58 -0
58 lines not on this page · raw message
include/configs/spear.h +73 -6
111 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH v4 12/12 SPEAr : Support added for SPEAr320 board
SPEAr320 SoC support contains basic spear320 support along with the usage of following drivers
- serial driver(UART)
- i2c driver
- smi driver
- nand driver(FSMC)
- usbd driver
- emi driver(cfi support)
--- MAKEALL | 1 + Makefile | 1 + board/spear/spear320/Makefile | 51 ++++++++++++++++++++++++++++++++++ board/spear/spear320/config.mk | 44 +++++++++++++++++++++++++++++ board/spear/spear320/spear320.c | 58 +++++++++++++++++++++++++++++++++++++++ include/configs/spear.h | 26 +++++++++++++++++ 6 files changed, 181 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 +44 -0
44 lines not on this page · raw message
board/spear/spear320/spear320.c new file +58 -0
58 lines not on this page · raw message
include/configs/spear.h +26 -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 /*
@@ -105,6 +108,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 /*
@@ -194,6 +209,17 @@ CONFIG_SYS_CS5_FLASH_BASE }#define CONFIG_SYS_MAX_FLASH_BANKS 6 +#elif defined(CONFIG_SPEAR320 ) +#define CONFIG_SYS_FLASH_BASE 0x44000000 +#define CONFIG_SYS_CS1_FLASH_BASE 0x45000000 +#define CONFIG_SYS_CS2_FLASH_BASE 0x46000000 +#define CONFIG_SYS_CS3_FLASH_BASE 0x47000000 +#define CONFIG_SYS_FLASH_BANKS_LIST { CONFIG_SYS_FLASH_BASE, \ + CONFIG_SYS_CS1_FLASH_BASE, \ + CONFIG_SYS_CS2_FLASH_BASE, \ + CONFIG_SYS_CS3_FLASH_BASE } +#define CONFIG_SYS_MAX_FLASH_BANKS 4 +#endif #define CONFIG_SYS_MAX_FLASH_SECT (127 + 8)
Signature · 1 line
1.6.0.2
PATCH v4 3/12 SPEAr : i2c driver support added for SPEAr SoCs
In reply to Vipin KUMARHello Vipin,
Quoted 4 lines · Vipin KUMAR
SPEAr SoCs contain a synopsys i2c controller.
This patch adds the driver for this IP.Signed-off-by Vipin <[email protected]>
Quoted 8 lines
--- drivers/i2c/Makefile | 1 + drivers/i2c/spr_i2c.c | 330 ++++++++++++++++++++++++++++++++++ include/asm-arm/arch-spear/spr_i2c.h | 146 +++++++++++++++ 3 files changed, 477 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
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