Skip to contentSkip to conversation

at91: Add support for Bluewater Systems Snapper 9G45 module

PATCH New Simon Glass 4 participants 6 messages Oct 23, 2011 – Nov 2, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 at91: Add support for Bluewater Systems Snapper 9G45 module

Snapper 9G45 is a ARM9-based CPU module with 1GB NAND and 128MB DDR SDRAM. This patch includes NAND and Ethernet support.

---
 board/bluewater/snapper9g45/Makefile      |   43 +++++++
 board/bluewater/snapper9g45/snapper9g45.c |  155 +++++++++++++++++++++++
 boards.cfg                                |    1 +
 include/configs/snapper9g45.h             |  189 +++++++++++++++++++++++++++++
 4 files changed, 388 insertions(+), 0 deletions(-)
 create mode 100644 board/bluewater/snapper9g45/Makefile
 create mode 100644 board/bluewater/snapper9g45/snapper9g45.c
 create mode 100644 include/configs/snapper9g45.h
board/bluewater/snapper9g45/Makefile new file +43 -0
new file mode 100644
index 0000000..9016e5a
@@ -0,0 +1,43 @@
+#
+# (C) Copyright 2003-2008
+# 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$(BOARD).o
+
+COBJS-y += snapper9g45.o
+
+SRCS	:= $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/bluewater/snapper9g45/snapper9g45.c new file +155 -0

155 lines not on this page · raw message

boards.cfg +1 -0
index 738c186..b56f1d0 100644
@@ -95,6 +95,7 @@ at91sam9xeek_dataflash_cs0   arm         arm926ejs   at91sam9260ek       atmel
 at91sam9xeek_dataflash_cs1   arm         arm926ejs   at91sam9260ek       atmel          at91        at91sam9260ek:AT91SAM9XE,SYS_USE_DATAFLASH_CS1
 snapper9260                  arm         arm926ejs   -                   bluewater      at91        snapper9260:AT91SAM9260
 snapper9g20                  arm         arm926ejs   snapper9260         bluewater      at91        snapper9260:AT91SAM9G20
+snapper9g45                  arm         arm926ejs   snapper9g45         bluewater      at91        snapper9g45:AT91SAM9G45
 sbc35_a9g20_nandflash        arm         arm926ejs   sbc35_a9g20         calao          at91        sbc35_a9g20:AT91SAM9G20,SYS_USE_NANDFLASH
 sbc35_a9g20_eeprom           arm         arm926ejs   sbc35_a9g20         calao          at91        sbc35_a9g20:AT91SAM9G20,SYS_USE_EEPROM
 tny_a9g20_nandflash          arm         arm926ejs   tny_a9260           calao          at91        tny_a9260:AT91SAM9G20,SYS_USE_NANDFLASH
include/configs/snapper9g45.h new file +189 -0

189 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/1 at91: Add support for Bluewater Systems Snapper 9G45 module

Dear Simon Glass,

Quoted 15 lines

Snapper 9G45 is a ARM9-based CPU module with 1GB NAND and 128MB DDR SDRAM. This patch includes NAND and Ethernet support.

---
  board/bluewater/snapper9g45/Makefile      |   43 +++++++
  board/bluewater/snapper9g45/snapper9g45.c |  155 +++++++++++++++++++++++
  boards.cfg                                |    1 +
  include/configs/snapper9g45.h             |  189 +++++++++++++++++++++++++++++
  4 files changed, 388 insertions(+), 0 deletions(-)

create mode 100644 board/bluewater/snapper9g45/Makefile create mode 100644 board/bluewater/snapper9g45/snapper9g45.c create mode 100644 include/configs/snapper9g45.h

[...]

include/configs/snapper9g45.h line 101

Quoted 6 lines
include/configs/snapper9g45.h new file +6 -0
+
+#ifndef NEW
+#define CONFIG_PCA953X
+#define CONFIG_SYS_I2C_PCA953X_ADDR	0x28
+#define CONFIG_SYS_I2C_PCA953X_WIDTH	{ {0x28, 16} }
+#endif

if that is a board variant, use something better than just "NEW" - and where would that ever get defined?

Review

Quoted 2 lines
(quoted diff) +2 -0
+/* Command line configuration */
+#include<config_cmd_default.h>

Space missing here.

Please run checkpatch before submitting!

Best Regards,
Reinhard

#2 lore raw

PATCH 1/1 at91: Add support for Bluewater Systems Snapper 9G45 module

Hi Reinhard,

Quoted 20 lines · Reinhard Meyer

Dear Simon Glass,

Quoted 18 lines

Snapper 9G45 is a ARM9-based CPU module with 1GB NAND and 128MB DDR SDRAM. This patch includes NAND and Ethernet support.

---
 board/bluewater/snapper9g45/**Makefile      |   43 +++++++
 board/bluewater/snapper9g45/**snapper9g45.c |  155
+++++++++++++++++++++++
 boards.cfg                                |    1 +
 include/configs/snapper9g45.h             |  189
+++++++++++++++++++++++++++++
 4 files changed, 388 insertions(+), 0 deletions(-)
 create mode 100644 board/bluewater/snapper9g45/**Makefile
 create mode 100644 board/bluewater/snapper9g45/**snapper9g45.c
 create mode 100644 include/configs/snapper9g45.h

[...]

Quoted 10 lines

include/configs/snapper9g45.h line 101

Quoted 7 lines
include/configs/snapper9g45.h new file +6 -0
+
+#ifndef NEW
+#define CONFIG_PCA953X
+#define CONFIG_SYS_I2C_PCA953X_ADDR    0x28
+#define CONFIG_SYS_I2C_PCA953X_WIDTH   { {0x28, 16} }
+#endif

if that is a board variant, use something better than just "NEW" - and where would that ever get defined?

Actually that can all be removed - will resubmit.

Quoted 8 lines

+/* Command line configuration */

Quoted 2 lines

+#include<config_cmd_default.**h>

Space missing here.

I don't see that missing space in my patch above - where did it come from?

Quoted 2 lines

Please run checkpatch before submitting!

Yes I do this as part of patch submission, honest!

Regards,
Simon

Quoted 5 lines

Best Regards,
Reinhard

#3 lore raw

PATCH v2 1/1 at91: Add support for Bluewater Systems Snapper 9G45 module

In reply to Simon Glass

Snapper 9G45 is a ARM9-based CPU module with 1GB NAND and 128MB DDR SDRAM. This patch includes NAND and Ethernet support.

---
Changes in v2:
- Removed unneeded i2c config
- Added machine type define

 board/bluewater/snapper9g45/Makefile      |   43 +++++++
 board/bluewater/snapper9g45/snapper9g45.c |  155 ++++++++++++++++++++++++
 boards.cfg                                |    1 +
 include/configs/snapper9g45.h             |  185 +++++++++++++++++++++++++++++
 4 files changed, 384 insertions(+), 0 deletions(-)
 create mode 100644 board/bluewater/snapper9g45/Makefile
 create mode 100644 board/bluewater/snapper9g45/snapper9g45.c
 create mode 100644 include/configs/snapper9g45.h
board/bluewater/snapper9g45/Makefile new file +43 -0
new file mode 100644
index 0000000..9016e5a
@@ -0,0 +1,43 @@
+#
+# (C) Copyright 2003-2008
+# 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$(BOARD).o
+
+COBJS-y += snapper9g45.o
+
+SRCS	:= $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/bluewater/snapper9g45/snapper9g45.c new file +155 -0

155 lines not on this page · raw message

boards.cfg +1 -0
index 604becf..b6123c2 100644
@@ -94,6 +94,7 @@ at91sam9xeek_dataflash_cs0   arm         arm926ejs   at91sam9260ek       atmel
 at91sam9xeek_dataflash_cs1   arm         arm926ejs   at91sam9260ek       atmel          at91        at91sam9260ek:AT91SAM9XE,SYS_USE_DATAFLASH_CS1
 snapper9260                  arm         arm926ejs   -                   bluewater      at91        snapper9260:AT91SAM9260
 snapper9g20                  arm         arm926ejs   snapper9260         bluewater      at91        snapper9260:AT91SAM9G20
+snapper9g45                  arm         arm926ejs   snapper9g45         bluewater      at91        snapper9g45:AT91SAM9G45
 sbc35_a9g20_nandflash        arm         arm926ejs   sbc35_a9g20         calao          at91        sbc35_a9g20:AT91SAM9G20,SYS_USE_NANDFLASH
 sbc35_a9g20_eeprom           arm         arm926ejs   sbc35_a9g20         calao          at91        sbc35_a9g20:AT91SAM9G20,SYS_USE_EEPROM
 tny_a9g20_nandflash          arm         arm926ejs   tny_a9260           calao          at91        tny_a9260:AT91SAM9G20,SYS_USE_NANDFLASH
include/configs/snapper9g45.h new file +185 -0

185 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#4 lore raw

PATCH v2 1/1 at91: Add support for Bluewater Systems Snapper 9G45 module

Hi Simon,

board/bluewater/snapper9g45/snapper9g45.c line 66

Quoted 5 lines · Simon Glass
board/bluewater/snapper9g45/snapper9g45.c new file +5 -0
+	/* Need to reset PHY -> 500ms reset */
+	erstl = readl(&rstc->mr) & AT91_RSTC_MR_ERSTL_MASK;
+	writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(13) |
+	       AT91_RSTC_MR_URSTEN, &rstc->mr);
+	writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST, &rstc->cr);

You don't actually need to reset the PHY for 500ms, only 100us, so the AT91_RSTC_MR_ERSTL(13) can be replaced with AT91_RSTC_MR_ERSTL(0), which give you the minimum delay (62ms I think).

Regards,
Andre

Signature · 8 lines
Bluewater Systems - An Aiotec Company

Andre Renaud        		
andre at bluewatersys.com          5 Amuri Park, 404 Barbadoes St
www.bluewatersys.com            PO Box 13 889, Christchurch 8013
www.aiotec.co.nz                New Zealand
Phone: +64 3 3779127            Freecall: Australia 1800 148 751
Fax:   +64 3 3779135            USA 1800 261 2934
#5 lore raw

PATCH v2 1/1 at91: Add support for Bluewater Systems Snapper 9G45 module

In reply to Simon Glass

Hi Simon,

Quoted 17 lines · Simon Glass

Snapper 9G45 is a ARM9-based CPU module with 1GB NAND and 128MB DDR SDRAM. This patch includes NAND and Ethernet support.

---
Changes in v2:
- Removed unneeded i2c config
- Added machine type define

 board/bluewater/snapper9g45/Makefile      |   43 +++++++
 board/bluewater/snapper9g45/snapper9g45.c |  155 ++++++++++++++++++++++++
 boards.cfg                                |    1 +
 include/configs/snapper9g45.h             |  185 +++++++++++++++++++++++++++++
 4 files changed, 384 insertions(+), 0 deletions(-)
 create mode 100644 board/bluewater/snapper9g45/Makefile
 create mode 100644 board/bluewater/snapper9g45/snapper9g45.c
 create mode 100644 include/configs/snapper9g45.h

[...]

Quoted 5 lines
board/bluewater/snapper9g45/snapper9g45.c new file +0 -0
new file mode 100644
index 0000000..f057e59

[...]

board/bluewater/snapper9g45/snapper9g45.c line 130

Quoted 12 lines
board/bluewater/snapper9g45/snapper9g45.c new file +12 -0
+
+int board_init(void)
+{
+	struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
+
+	/* Enable PIO clocks */
+	writel((1 << ATMEL_ID_PIOA) |
+		(1 << ATMEL_ID_PIOB) |
+		(1 << ATMEL_ID_PIOC |
+		(1 << ATMEL_ID_PIODE)), &pmc->pcer);
+
+	gd->bd->bi_arch_number = MACH_TYPE_SNAPPER9G45;

Please, use common code facilities (check CONFIG_MACH_TYPE in README).

board/bluewater/snapper9g45/snapper9g45.c line 137

Quoted 7 lines
board/bluewater/snapper9g45/snapper9g45.c new file +7 -0
+
+	/* Address of boot parameters */
+	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
+
+	/* Initialise peripherals */
+	at91_seriald_hw_init();
+	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);

Why do you need the additional i2c_init() call here? It is already called in the init_sequence[] array.

Quoted 7 lines
board/bluewater/snapper9g45/snapper9g45.c new file +7 -0
+	nand_hw_init();
+
+	macb_hw_init();
+
+	return 0;
+}
+

[...]

Signature · 2 lines
Regards,
Igor.