Re: [U-Boot] [PATCH] add new board nas62x0

2012-03-16 Thread DrEagle
Hi all,

may be it can be also imported in debian-uboot package ?

more available at :
https://doukki.net/doku.php?id=wiki:notes:ib-nas6220-b

Le 16/03/2012 00:59, Luka Perkov a écrit :
 Add support for new boards RaidSonic ICY BOX NAS6210 and NAS6220 boards.
 
 Only difference between boards is number of SATA ports. By default we
 use only one SATA port. In order to use both SATA ports on NAS6220
 define CONFIG_NAS6220 in board config file.
 
 Signed-off-by: Luka Perkov ub...@lukaperkov.net
 Signed-off-by: Gerald Kerma drea...@doukki.net
 ---
 
 If you want to test the boot loader without touching nand you can boot
 u-boot using UART. In order to create UART image you need to change
 image configuration from nand to uart:
 
 sed -i 's/nand/uart/' board/Marvell/ib62x0/kwbimage.cfg
 
 To boot your kirkwood board from UART you will need this tool:
 
 http://www.solinno.co.uk/public/kwuartboot/
 http://www.solinno.co.uk/public/kwuartboot/kwuartboot-0.1.tar.gz
 
 Compile and run it like this:
 
 ./kwuartboot /dev/ttyUSB0 /path/to/u-boot.kwb
 
 And when it's finished open the console.
 
Add support for new boards RaidSonic ICY BOX NAS6210 and NAS6220 boards.

Only difference between boards is number of SATA ports. By default we
use only one SATA port. In order to use both SATA ports on NAS6220
define CONFIG_NAS6220 in board config file.

Signed-off-by: Luka Perkov ub...@lukaperkov.net
Signed-off-by: Gerald Kerma drea...@doukki.net
---

If you want to test the boot loader without touching nand you can boot
u-boot using UART. In order to create UART image you need to change
image configuration from nand to uart:

sed -i 's/nand/uart/' board/Marvell/ib62x0/kwbimage.cfg

To boot your kirkwood board from UART you will need this tool:

http://www.solinno.co.uk/public/kwuartboot/
http://www.solinno.co.uk/public/kwuartboot/kwuartboot-0.1.tar.gz

Compile and run it like this:

./kwuartboot /dev/ttyUSB0 /path/to/u-boot.kwb

And when it's finished open the console.

diff --git a/board/Marvell/ib62x0/Makefile b/board/Marvell/ib62x0/Makefile
new file mode 100644
index 000..3d82f27
--- /dev/null
+++ b/board/Marvell/ib62x0/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor www.marvell.com
+# Written-by: Prafulla Wadaskar prafu...@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := ib62x0.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/Marvell/ib62x0/ib62x0.c b/board/Marvell/ib62x0/ib62x0.c
new file mode 100644
index 000..2fad48d
--- /dev/null
+++ b/board/Marvell/ib62x0/ib62x0.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2011 Gérald Kerma drea...@doukki.net
+ *
+ * Written-by: Gérald Kerma drea...@doukki.net
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include common.h
+#include miiphy.h
+#include asm/arch/cpu.h
+#include asm/arch/kirkwood.h
+#include asm/arch/mpp.h

Re: [U-Boot] [PATCH] add new board nas62x0

2012-03-16 Thread Wolfgang Denk
Dear DrEagle,

In message 4f62ddef.8000...@doukki.net you wrote:
 
 may be it can be also imported in debian-uboot package ?

Please do not top post / full quote.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The more sins you confess, the more books you will sell.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] add new board nas62x0

2012-03-16 Thread Wolfgang Denk
Dear Luka Perkov,

In message 20120315235958.GA16846@w500.iskon.local you wrote:

 Add support for new boards RaidSonic ICY BOX NAS6210 and NAS6220 boards.

Checkpatch reports a number of issues:

WARNING: please, no space before tabs
ERROR: trailing whitespace
WARNING: please, no spaces at the start of a line

Please fix these.

 Only difference between boards is number of SATA ports. By default we
 use only one SATA port. In order to use both SATA ports on NAS6220
 define CONFIG_NAS6220 in board config file.

You should provide a second entry to boards.cfg then which sets this
define, so that editing of the board config file is not needed.

 If you want to test the boot loader without touching nand you can boot
 u-boot using UART. In order to create UART image you need to change
 image configuration from nand to uart:
 
 sed -i 's/nand/uart/' board/Marvell/ib62x0/kwbimage.cfg
 
 To boot your kirkwood board from UART you will need this tool:
 
 http://www.solinno.co.uk/public/kwuartboot/
 http://www.solinno.co.uk/public/kwuartboot/kwuartboot-0.1.tar.gz
 
 Compile and run it like this:
 
 ./kwuartboot /dev/ttyUSB0 /path/to/u-boot.kwb
 
 And when it's finished open the console.

This text should probably be added to a README and checked in.  As is,
this information gets lost for the users.


 +#ifdef CONFIG_RESET_PHY_R
 +/*
 + * This must be here because of the compile issue if missing
 + */
 +void reset_phy(void) {}
 +#endif /* CONFIG_RESET_PHY_R */

This makes no sense.  If you don't need reset_phy(), then don't define
CONFIG_RESET_PHY


 +/*
 + * High Level Configuration Options (easy to change)
 + */
 +#define CONFIG_FEROCEON_88FR131  1   /* CPU Core subversion */
 +#define CONFIG_KIRKWOOD  1   /* SOC Family Name */
 +#define CONFIG_KW88F6281 1   /* SOC Name */

Please don't define values for macros that enable features only.
Please fix globally.

...
 +/*
 + * Memory Info
 + */
 +#define CONFIG_NR_DRAM_BANKS 1   /* we have 1 bank of DRAM */
 +#define PHYS_SDRAM_1_SIZE(256  20) /* SDRAM size 256MB */

please use get_ram_size() instead and auto-size the memory.

 +#define CONFIG_MAX_RAM_BANK_SIZE (256  20)
...

 +/*
 + * max 4k env size is enough, but in case of nand
 + * it has to be rounded to sector size
 + */

I think this is not correct.


 +#define CONFIG_ENV_ADDR  0x8
 +#define CONFIG_ENV_OFFSET0x8 /* env starts here */

Using both ADDR and OFFSET is redundant at best.  Drop one.

 +/* Data, registers and alternate blocks are at the same offset */
 +#define CONFIG_SYS_ATA_DATA_OFFSET   (0x0100)
 +#define CONFIG_SYS_ATA_REG_OFFSET(0x0100)
 +#define CONFIG_SYS_ATA_ALT_OFFSET(0x0100)

Please do not use parens for simple parameters.  Please fix globally.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Speed of a tortoise breaking the sound barrier = 1 Machturtle
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] add new board nas62x0

2012-03-16 Thread Wolfgang Denk
Dear Luka Perkov,

In message 20120315235958.GA16846@w500.iskon.local you wrote:
 
 Add support for new boards RaidSonic ICY BOX NAS6210 and NAS6220 boards.

BTW:   Please use git-format-patch to create the patches, or at least
make sure we get a statistics which files were changed / added.

For example, it nearly espcaped me that there is no entry to the
MAINTAINERS file in your patch.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Those who do not  understand  Unix  are  condemned  to  reinvent  it,
poorly.  - Henry Spencer, University of Toronto Unix hack
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] add new board nas62x0

2012-03-15 Thread Luka Perkov
Add support for new boards RaidSonic ICY BOX NAS6210 and NAS6220 boards.

Only difference between boards is number of SATA ports. By default we
use only one SATA port. In order to use both SATA ports on NAS6220
define CONFIG_NAS6220 in board config file.

Signed-off-by: Luka Perkov ub...@lukaperkov.net
Signed-off-by: Gerald Kerma drea...@doukki.net
---

If you want to test the boot loader without touching nand you can boot
u-boot using UART. In order to create UART image you need to change
image configuration from nand to uart:

sed -i 's/nand/uart/' board/Marvell/ib62x0/kwbimage.cfg

To boot your kirkwood board from UART you will need this tool:

http://www.solinno.co.uk/public/kwuartboot/
http://www.solinno.co.uk/public/kwuartboot/kwuartboot-0.1.tar.gz

Compile and run it like this:

./kwuartboot /dev/ttyUSB0 /path/to/u-boot.kwb

And when it's finished open the console.

diff --git a/board/Marvell/ib62x0/Makefile b/board/Marvell/ib62x0/Makefile
new file mode 100644
index 000..3d82f27
--- /dev/null
+++ b/board/Marvell/ib62x0/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor www.marvell.com
+# Written-by: Prafulla Wadaskar prafu...@marvell.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., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := ib62x0.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/Marvell/ib62x0/ib62x0.c b/board/Marvell/ib62x0/ib62x0.c
new file mode 100644
index 000..2fad48d
--- /dev/null
+++ b/board/Marvell/ib62x0/ib62x0.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (C) 2011 G??rald Kerma drea...@doukki.net
+ *
+ * Written-by: G??rald Kerma drea...@doukki.net
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include common.h
+#include miiphy.h
+#include asm/arch/cpu.h
+#include asm/arch/kirkwood.h
+#include asm/arch/mpp.h
+#include ib62x0.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_early_init_f(void)
+{
+   /*
+* default gpio configuration
+* There are maximum 64 gpios controlled through 2 sets of registers
+* the below configuration configures mainly initial LED status
+*/
+   kw_config_gpio(IB62x0_OE_VAL_LOW,
+   IB62x0_OE_VAL_HIGH,
+   IB62x0_OE_LOW, IB62x0_OE_HIGH);
+
+   /* Multi-Purpose Pins Functionality configuration */
+   u32 kwmpp_config[] = {
+   MPP0_NF_IO2,
+   MPP1_NF_IO3,
+   MPP2_NF_IO4,
+   MPP3_NF_IO5,
+   MPP4_NF_IO6,
+   MPP5_NF_IO7,
+   MPP6_SYSRST_OUTn,
+   MPP7_GPO,
+   MPP8_UART0_RTS,
+   MPP8_UART0_RTS,
+   MPP9_UART0_CTS,
+   MPP10_UART0_TXD,
+   MPP11_UART0_RXD,
+   MPP12_SD_CLK,
+   MPP13_SD_CMD,
+   MPP14_SD_D0,
+   MPP15_SD_D1,
+   MPP16_SD_D2,
+   MPP17_SD_D3,
+