Initial support for Nomadik 8815 development board
PATCH v2 1/1 Initial support for Nomadik 8815 development board
Subject: Initial support for Nomadik 8815 development board
From: Alessandro Rubini <[email protected]>
The NMDK8815 board is distributed by ST Microelectornics. This is the initial port, with basic infrastructure and a working serial port.
---
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
MAINTAINERS +5 -0
@@ -581,6 +581,11 @@ Stefan Roese <[email protected]> pdnb3 xscale scpu xscale +Alessandro Rubini <[email protected]> +Nomadik Linux Team <[email protected]> + + nmdk8815 ARM926EJS (Nomadik 8815 Soc) + Robert Schwebel <[email protected]> csb226 xscale
MAKEALL +1 -0
@@ -487,6 +487,7 @@ LIST_ARM9=" \ mx1ads \ mx1fs2 \ netstar \ + nmdk8815 \ omap1510inn \ omap1610h2 \ omap1610inn \
Makefile +11 -0
@@ -2612,6 +2612,17 @@ mx1fs2_config : unconfig netstar_config: unconfig @$(MKCONFIG) $(@:_config=) arm arm925t netstar +nmdk8815_config \ +nmdk8815_onenand_config: unconfig + @ > $(obj)include/config.h + @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 + omap1510inn_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm925t omap1510inn
board/nmdk8815/Makefile new file +53 -0
53 lines not on this page · raw message
board/nmdk8815/config.mk new file +26 -0
@@ -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
board/nmdk8815/nmdk8815.c new file +76 -0
76 lines not on this page · raw message
board/nmdk8815/platform.S new file +351 -0
351 lines not on this page · raw message
board/nmdk8815/u-boot.lds new file +51 -0
51 lines not on this page · raw message
cpu/arm926ejs/nomadik/Makefile new file +46 -0
46 lines not on this page · raw message
cpu/arm926ejs/nomadik/reset.S new file +27 -0
@@ -0,0 +1,27 @@ +#include <config.h> +/* + * Processor reset for Nomadik + */ + + .align 5 +.globl reset_cpu +reset_cpu: +#if defined CONFIG_NOMADIK_8815 + ldr r0, =NOMADIK_SRC_BASE + ldr r1, =0x1 + str r1, [r0, #0x18] +#else + ldr r1, rstctl1 /* get clkm1 reset ctl */ + mov r3, #0x0 + strh r3, [r1] /* clear it */ + mov r3, #0x8 + strh r3, [r1] /* force dsp+arm reset */ +#endif +_loop_forever: + b _loop_forever + + +rstctl1: + .word 0xfffece10 + +
cpu/arm926ejs/nomadik/timer.c new file +180 -0
180 lines not on this page · raw message
include/configs/nmdk8815.h new file +187 -0
187 lines not on this page · raw message
Signature · 1 line
1.6.0.2
PATCH v2 1/1 Initial support for Nomadik 8815 development board
Quoted 6 lines · Alessandro Rubini
Subject: Initial support for Nomadik 8815 development board
From: Alessandro Rubini <[email protected]>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
Quoted 64 lines
Signed-off-by Alessandro Rubini <[email protected]>---
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.hMAINTAINERS +5
-0@@ -581,6 +581,11 @@ Stefan Roese <[email protected]> pdnb3 xscale scpu xscale +Alessandro Rubini <[email protected]> +Nomadik Linux Team <[email protected]> + + nmdk8815 ARM926EJS (Nomadik 8815 Soc) + Robert Schwebel <[email protected]> csb226 xscaleMAKEALL +1
-0@@ -487,6 +487,7 @@ LIST_ARM9=" \ mx1ads \ mx1fs2 \ netstar \ + nmdk8815 \ omap1510inn \ omap1610h2 \ omap1610inn \Makefile +0
-0
Makefile mx1fs2_config : unconfig · line 2616
Quoted 5 lines
Makefile +2
-0@@ -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
Makefile mx1fs2_config : unconfig · line 2617
Quoted 1 line
Makefile +1
-0+ @ > $(obj)include/config.h
^^^^^
please remove
Makefile mx1fs2_config : unconfig · line 2624
Quoted 7 lines
Makefile +7
-0+ @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)
Quoted 31 lines
Makefile +1
-0+ omap1510inn_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm925t omap1510innboard/nmdk8815/Makefile new file +21
-0@@ -0,0 +1,53 @@ +# +# (C) Copyright 2000-2004 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# (C) Copyright 2004 +# ARM Ltd. +# Philippe Robin, <[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. +#
board/nmdk8815/Makefile line 31
Quoted 10 lines
board/nmdk8815/Makefile new file +10
-0+# 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??
board/nmdk8815/Makefile line 38
Quoted 7 lines
board/nmdk8815/Makefile new file +7
-0+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)
board/nmdk8815/Makefile line 44
Quoted 6 lines
board/nmdk8815/Makefile new file +6
-0+ +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak .depend
$(obj).depend
board/nmdk8815/Makefile line 51
Quoted 7 lines
board/nmdk8815/Makefile new file +7
-0+ +######################################################################### + +.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
Quoted 72 lines
board/nmdk8815/Makefile new file +2
-0+ +#########################################################################board/nmdk8815/config.mk new file +26
-0@@ -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 = 0x03F80000board/nmdk8815/nmdk8815.c new file +32
-0@@ -0,0 +1,76 @@ +/* +* (C) Copyright 2005 +* STMicrolelctronics, <www.st.com> +* +* (C) Copyright 2004 +* ARM Ltd. +* Philippe Robin, <[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 +*/ + +#include <common.h> +#include <asm/io.h> + +#ifdef CONFIG_SHOW_BOOT_PROGRESS +void show_boot_progress (int progress)
board/nmdk8815/nmdk8815.c line 42
Quoted 10 lines
board/nmdk8815/nmdk8815.c new file +10
-0+{ +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?
Quoted 40 lines
board/nmdk8815/nmdk8815.c new file +34
-0+ +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 ; +}board/nmdk8815/platform.S new file +0
-0
board/nmdk8815/platform.S line 2
Quoted 2 lines
board/nmdk8815/platform.S new file +2
-0@@ -0,0 +1,351 @@ +/* + * Board specific setup info
copyright??
Quoted 23 lines
board/nmdk8815/platform.S new file +23
-0+ * + * (C) Copyright 2004, ARM Ltd. + * Philippe Robin, <[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 + */ +
board/nmdk8815/platform.S line 35
Quoted 10 lines
board/nmdk8815/platform.S new file +10
-0+#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
/*
*
*/
board/nmdk8815/platform.S line 38
Quoted 3 lines
board/nmdk8815/platform.S new file +3
-0+ /* 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
board/nmdk8815/platform.S line 39
Quoted 1 line
board/nmdk8815/platform.S new file +1
-0+ orr lr, lr, r0 /* adjust return address */
^^
whitespace please fix
board/nmdk8815/platform.S line 40
Quoted 1 line
board/nmdk8815/platform.S new file +1
-0+ orr pc, pc, r0 /* jump to the normal address */
^^
whitespace please fix
and so on please fix
Quoted 14 lines
board/nmdk8815/platform.S new file +14
-0+ 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] + +
board/nmdk8815/platform.S line 91
Quoted 10 lines
board/nmdk8815/platform.S new file +10
-0+ 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
Quoted 18 lines
board/nmdk8815/platform.S new file +18
-0+ + /* 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] +
board/nmdk8815/platform.S line 119
Quoted 10 lines
board/nmdk8815/platform.S new file +10
-0+ /* 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] +
+
board/nmdk8815/u-boot.lds line 1
Quoted 7 lines
board/nmdk8815/u-boot.lds new file +1
-0@@ -0,0 +1,51 @@ +/*
copyrigth?
Quoted 23 lines
board/nmdk8815/u-boot.lds new file +23
-0+ * (C) Copyright 2002 + * Gary Jennejohn, DENX Software Engineering, <[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 + */ + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
board/nmdk8815/u-boot.lds line 34
Quoted 10 lines
board/nmdk8815/u-boot.lds new file +10
-0+OUTPUT_ARCH(arm) +ENTRY(_start) +SECTIONS +{ + . = 0x00000000; + . = ALIGN(4); + .text : + { + cpu/arm926ejs/start.o (.text) + *(.text)
^^
please use tab
Quoted 60 lines
board/nmdk8815/u-boot.lds new file +17
-0+ } + . = 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 = .; +}include/configs/nmdk8815.h new file +37
-0@@ -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>
include/configs/nmdk8815.h line 47
Quoted 10 lines
include/configs/nmdk8815.h new file +10
-0+#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
include/configs/nmdk8815.h line 51
Quoted 4 lines
include/configs/nmdk8815.h new file +4
-0+#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.