
On 12:29 Tue 04 Nov , Alessandro Rubini wrote:
Subject: Initial support for Nomadik 8815 development board From: Alessandro Rubini rubini@unipv.it
The NMDK8815 board is distributed by ST Microelectornics. This is the initial port, with basic infrastructure and a working serial port.
As you and I known the patch is a port from ST version 1.1.4 or their last 1.3.1 IIRC. So your patch have steel some old code inside.
First could you ST in the loop please? Secondly please create a vendor dir
Signed-off-by: Alessandro Rubini rubini@unipv.it
After the first post of Oct 30th I found checkpatch complains. This fixes those complains but two, (one acceptable extern and a false positive from checkpatch).
MAINTAINERS | 5 + MAKEALL | 1 + Makefile | 11 ++ board/nmdk8815/Makefile | 53 ++++++ board/nmdk8815/config.mk | 26 +++ board/nmdk8815/nmdk8815.c | 76 +++++++++ board/nmdk8815/platform.S | 351 ++++++++++++++++++++++++++++++++++++++++ board/nmdk8815/u-boot.lds | 51 ++++++ cpu/arm926ejs/nomadik/Makefile | 46 ++++++ cpu/arm926ejs/nomadik/reset.S | 27 +++ cpu/arm926ejs/nomadik/timer.c | 180 ++++++++++++++++++++ include/configs/nmdk8815.h | 187 +++++++++++++++++++++ 12 files changed, 1014 insertions(+), 0 deletions(-) create mode 100644 board/nmdk8815/Makefile create mode 100644 board/nmdk8815/config.mk create mode 100644 board/nmdk8815/nmdk8815.c create mode 100644 board/nmdk8815/platform.S create mode 100644 board/nmdk8815/u-boot.lds create mode 100644 cpu/arm926ejs/nomadik/Makefile create mode 100644 cpu/arm926ejs/nomadik/reset.S create mode 100644 cpu/arm926ejs/nomadik/timer.c create mode 100644 include/configs/nmdk8815.h
diff --git a/MAINTAINERS b/MAINTAINERS index a7f9b87..8cf5910 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -581,6 +581,11 @@ Stefan Roese sr@denx.de pdnb3 xscale scpu xscale
+Alessandro Rubini rubini@unipv.it +Nomadik Linux Team STN_WMM_nomadik_linux@list.st.com
- nmdk8815 ARM926EJS (Nomadik 8815 Soc)
Robert Schwebel r.schwebel@pengutronix.de
csb226 xscale diff --git a/MAKEALL b/MAKEALL index 1f56ac5..347fe73 100755 --- a/MAKEALL +++ b/MAKEALL @@ -487,6 +487,7 @@ LIST_ARM9=" \ mx1ads \ mx1fs2 \ netstar \
- nmdk8815 \ omap1510inn \ omap1610h2 \ omap1610inn \
diff --git a/Makefile b/Makefile index 983a3cd..fe3b67a 100644 --- a/Makefile +++ b/Makefile @@ -2612,6 +2612,17 @@ mx1fs2_config : unconfig netstar_config: unconfig @$(MKCONFIG) $(@:_config=) arm arm925t netstar
+nmdk8815_config \ +nmdk8815_onenand_config: unconfig
^^^^^ please replace by tab
- @ > $(obj)include/config.h
^^^^^ please remove
- @if [ "$(findstring _onenand, $@)" ] ; then \
echo "#define CONFIG_BOOT_ONENAND" >> $(obj)include/config.h; \
$(XECHO) "... configured for OneNand Flash"; \
- else \
$(XECHO) "... configured for Nand Flash"; \
- fi
- @./mkconfig -a nmdk8815 arm arm926ejs nmdk8815 NULL nomadik
please use $(MKCONFIG)
omap1510inn_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm925t omap1510inn
diff --git a/board/nmdk8815/Makefile b/board/nmdk8815/Makefile new file mode 100644 index 0000000..50ff6dd --- /dev/null +++ b/board/nmdk8815/Makefile @@ -0,0 +1,53 @@ +# +# (C) Copyright 2000-2004 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# (C) Copyright 2004 +# ARM Ltd. +# Philippe Robin, philippe.robin@arm.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 $(TOPDIR)/config.mk
+CFLAGS += -D__I2C_ENHANCED -D__RELEASE -D__NOMADIK_I2C -D__STN_8815=10 +CFLAGS += -DSTN8815 -D__MMCI_HCL_ENHANCED -D__MMCI_HCL_ELEMENTARY
please could explain the following CFLAGS??
+LIB = lib$(BOARD).a
+OBJS := nmdk8815.o +SOBJS := platform.o
+$(LIB): $(OBJS) $(SOBJS)
- $(AR) crv $@ $^
please replace with
SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) SOBJS := $(addprefix $(obj),$(SOBJS))
$(LIB): $(obj).depend $(OBJS) $(AR) $(ARFLAGS) $@ $(OBJS)
+clean:
- rm -f $(SOBJS) $(OBJS)
+distclean: clean
- rm -f $(LIB) core *.bak .depend
$(obj).depend
+#########################################################################
+.depend: Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
$(CC) -M -g3 $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+-include .depend
pelase replace by # defines $(obj).depend target include $(SRCTREE)/rules.mk
sinclude $(obj).depend
+######################################################################### diff --git a/board/nmdk8815/config.mk b/board/nmdk8815/config.mk new file mode 100644 index 0000000..590393b --- /dev/null +++ b/board/nmdk8815/config.mk @@ -0,0 +1,26 @@ +# (C) Copyright 2007 +# STMicroelectronics, <www.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 +# +# +# image should be loaded at 0x01000000 +#
+TEXT_BASE = 0x03F80000 diff --git a/board/nmdk8815/nmdk8815.c b/board/nmdk8815/nmdk8815.c new file mode 100644 index 0000000..6effafe --- /dev/null +++ b/board/nmdk8815/nmdk8815.c @@ -0,0 +1,76 @@ +/*
- (C) Copyright 2005
- STMicrolelctronics, <www.st.com>
- (C) Copyright 2004
- ARM Ltd.
- Philippe Robin, philippe.robin@arm.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/io.h>
+#ifdef CONFIG_SHOW_BOOT_PROGRESS +void show_boot_progress(int progress) +{
- printf("%i\n", progress);
+} +#endif
+/*
- Miscellaneous platform dependent initialisations
- */
+__u16 cpld_uart0 = 0x0100, uart0_value = 0; +__u16 cpld_eth_reset = 0x6888, eth_reset_value = 0;
could you use macro instead a hardcode value?
+int board_init(void) +{
- DECLARE_GLOBAL_DATA_PTR;
- gd->bd->bi_arch_number = MACH_TYPE_NOMADIK;
- gd->bd->bi_boot_params = 0x00000100;
- writel(0xC37800F0, NOMADIK_GPIO1_BASE + 0x20);
- writel(0x00000000, NOMADIK_GPIO1_BASE + 0x24);
- writel(0x00000000, NOMADIK_GPIO1_BASE + 0x28);
- writel(readl(NOMADIK_SRC_BASE) | 0x8000, NOMADIK_SRC_BASE);
- icache_enable();
- return 0;
+}
+int misc_init_r(void) +{
- setenv("verify", "n");
- return (0);
+}
+int dram_init(void) +{
- DECLARE_GLOBAL_DATA_PTR;
- /* set dram bank start addr and size */
- gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
- gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
- gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
- gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
- return 0;
+} diff --git a/board/nmdk8815/platform.S b/board/nmdk8815/platform.S new file mode 100644 index 0000000..63c188d --- /dev/null +++ b/board/nmdk8815/platform.S @@ -0,0 +1,351 @@ +/*
- Board specific setup info
copyright??
- (C) Copyright 2004, ARM Ltd.
- Philippe Robin, philippe.robin@arm.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 <config.h> +#include <version.h>
+.globl lowlevel_init +lowlevel_init:
- /* Jump to the flash address */
- ldr r0, =CFG_ONENAND_BASE
- /* orr-ing makes it independent whether we boot from 0x0
or 0x30000000 */
please use this style of comment /* * */
- /* This code is non-portable, relies on the knowledge that ip
has to be updated */
- orr ip, ip, r0 /* adjust return address of cpu_init_crit */
^^ whitespace please fix
- orr lr, lr, r0 /* adjust return address */
^^ whitespace please fix
- orr pc, pc, r0 /* jump to the normal address */
^^ whitespace please fix and so on please fix
- nop
- /* Initialize PLL, Remap clear, FSMC, MPMC here! */
- /* What about GPIO, CLCD and UART */
- /* PLL Initialization */
- /* Prog the PLL1 @ 266 MHz ==> SDRAM Clock = 100.8 MHz */
- ldr r0, =NOMADIK_SRC_BASE
- ldr r1, =0x2B013502
- str r1, [r0, #0x14]
- add r0, r0, #0x20
- mcr p15, 0, r0, c7, c13, 1
- /* Put the SDRAM under MPMC control */
+/* ldr r0, =NOMADIK_SRC_BASE
- ldr r1, =0x00000008
- str r1, [r0,#0x9000]
+*/
please no dead code
- /* Now Clear Remap */
- ldr r0, =NOMADIK_SRC_BASE
- ldr r1, =0x2004
- str r1, [r0]
- ldr r1, =0x10000000
- str r1, [r0,#0x10]
- ldr r0,=0x101E9000
- ldr r1, =0x2004
- str r1, [r0]
- ldr r0, =NOMADIK_SRC_BASE
- ldr r1, =0x2104
- str r1, [r0]
- /* FSMC setup -- */
- mov r0, #(NOMADIK_FSMC_BASE & 0x10000000)
- orr r0, r0, #(NOMADIK_FSMC_BASE & 0x0FFFFFFF)
- ldr r1, =0x10DB /* For 16-bit NOR flash */
- str r1, [r0, #0x8]
- ldr r1, =0x03333333 /* For 16-bit NOR flash */
- str r1, [r0, #0xc]
+
diff --git a/board/nmdk8815/u-boot.lds b/board/nmdk8815/u-boot.lds new file mode 100644 index 0000000..eee4813 --- /dev/null +++ b/board/nmdk8815/u-boot.lds @@ -0,0 +1,51 @@ +/*
copyrigth?
- (C) Copyright 2002
- Gary Jennejohn, DENX Software Engineering, gj@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
- */
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_start) +SECTIONS +{
- . = 0x00000000;
- . = ALIGN(4);
- .text :
- {
cpu/arm926ejs/start.o (.text)
*(.text)
^^ please use tab
- }
- . = ALIGN(4);
- .rodata : { *(.rodata) }
- . = ALIGN(4);
- .data : { *(.data) }
- . = ALIGN(4);
- .got : { *(.got) }
- __u_boot_cmd_start = .;
- .u_boot_cmd : { *(.u_boot_cmd) }
- __u_boot_cmd_end = .;
- . = ALIGN(4);
- __bss_start = .;
- .bss : { *(.bss) }
- _end = .;
+} diff --git a/include/configs/nmdk8815.h b/include/configs/nmdk8815.h new file mode 100644 index 0000000..336d4e5 --- /dev/null +++ b/include/configs/nmdk8815.h @@ -0,0 +1,187 @@ +/*
- (C) Copyright 2005
- STMicroelectronics.
- Configuration settings for the STn8815 nomadik board.
- 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 __CONFIG_H +#define __CONFIG_H
+#define CONFIG_ARM926EJS +#define CONFIG_NOMADIK +#define CONFIG_NOMADIK_8815 +#define CONFIG_NOMADIK_NDK15 +#define CONFIG_NOMADIK_NHK15
+#define CONFIG_SKIP_LOWLEVEL_INIT /* we have already been loaded to RAM */
+/* commands */ +#include <config_cmd_default.h> +#define CONFIG_CMD_PING +#define CONFIG_CMD_DHCP +/* At this point there is no flash driver, so remove some commands */ +#undef CONFIG_CMD_ENV +#undef CONFIG_CMD_FLASH +#undef CONFIG_CMD_IMLS
+/* user interface */ +#define CONFIG_SYS_LONGHELP +#define CONFIG_SYS__HUSH_PARSER
please replace by #define CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT "Nomadik> " +#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " +#define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */ +#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
please add space before and after '+'
add please fix all whitespace
Best Regards, J.