Skip to contentSkip to conversation

: Add support for the muas3001 board

PATCH Superseded Heiko Schocher 2 participants 2 messages Aug 11, 2008 – Aug 18, 2008 Kbuild

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 : Add support for the muas3001 board

Hello,

[POWERPC] Added support for the muas3001 board from IAI,
based on a MPC8270 CPU.

---
 Makefile                   |    9 +
 board/muas3001/Makefile    |   50 ++++++
 board/muas3001/config.mk   |   24 +++
 board/muas3001/muas3001.c  |  388 ++++++++++++++++++++++++++++++++++++++++++++
 include/configs/muas3001.h |  382 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 853 insertions(+), 0 deletions(-)
 create mode 100644 board/muas3001/Makefile
 create mode 100644 board/muas3001/config.mk
 create mode 100644 board/muas3001/muas3001.c
 create mode 100644 include/configs/muas3001.h
Makefile +9 -0
index 3179c67..9c3de1c 100644
@@ -1672,6 +1672,15 @@ PQ2FADS-ZU_66MHz_lowboot_config	\
 MPC8266ADS_config:	unconfig
 	@$(MKCONFIG) $(@:_config=) ppc mpc8260 mpc8266ads freescale
 
+muas3001_dev_config \
+muas3001_config	:	unconfig
+	@mkdir -p $(obj)include
+	@mkdir -p $(obj)board/muas3001
+	@if [ "$(findstring dev,$@)" ] ; then \
+		echo "#define CONFIG_MUAS_DEV_BOARD" > $(obj)include/config.h ; \
+	fi
+	@$(MKCONFIG) -a muas3001 ppc mpc8260 muas3001
+
 # PM825/PM826 default configuration:  small (= 8 MB) Flash / boot from 64-bit flash
 PM825_config	\
 PM825_ROMBOOT_config	\
board/muas3001/Makefile new file +50 -0

50 lines not on this page · raw message

board/muas3001/config.mk new file +24 -0
new file mode 100644
index 0000000..cdd0ec9
@@ -0,0 +1,24 @@
+#
+# (C) Copyright 2008
+# Heiko Schocher, DENX Software Engineering, hs 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
+#
+
+TEXT_BASE = 0xFF000000
board/muas3001/muas3001.c new file +388 -0

388 lines not on this page · raw message

include/configs/muas3001.h new file +382 -0

382 lines not on this page · raw message

Signature · 7 lines
1.5.6.1



-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#1 lore raw

PATCH 1/2 : Add support for the muas3001 board

Dear Heiko,

Quoted 4 lines · In message <[email protected]> you wrote:

Hello,

[POWERPC] Added support for the muas3001 board from IAI,
based on a MPC8270 CPU.

...

Quoted 14 lines
board/muas3001/muas3001.c new file +14 -0
+#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
+/*
+ * update "memory" property in the blob
+ */
+void ft_blob_update(void *blob, bd_t *bd)
+{
+	int ret, nodeoffset = 0;
+	ulong memory_data[2] = {0};
+	ulong flash_data[4] = {0};
+	ulong freq = 0;
+	ulong	speed = 0;
+
+	memory_data[0] = cpu_to_be32(bd->bi_memstart);
+	memory_data[1] = cpu_to_be32(bd->bi_memsize);

board/muas3001/muas3001.c line 312

Quoted 10 lines
board/muas3001/muas3001.c new file +10 -0
+
+	nodeoffset = fdt_path_offset (blob, "/memory");
+	if (nodeoffset >= 0) {
+		ret = fdt_setprop(blob, nodeoffset, "reg", memory_data,
+					sizeof(memory_data));
+	if (ret < 0)
+		printf("ft_blob_update): cannot set /memory/reg "
+			"property err:%s\n", fdt_strerror(ret));
+	}
+	else {

Please make this

	} else {

here and everywhere else.

board/muas3001/muas3001.c line 331

Quoted 5 lines
board/muas3001/muas3001.c new file +5 -0
+	}
+	else {
+		/* memory node is required in dts */
+		printf("ft_blob_update(): cannot find /localbus node "
+		"err:%s\n", fdt_strerror(nodeoffset));

Indent the last line please.

Quoted 4 lines
board/muas3001/muas3001.c new file +4 -0
+	}
+	/* MAC Adresse */
+	nodeoffset = fdt_path_offset (blob, "/soc/cpm/ethernet");
+	if (nodeoffset >= 0) {

board/muas3001/muas3001.c line 345

Quoted 10 lines
board/muas3001/muas3001.c new file +10 -0
+		ret = fdt_setprop(blob, nodeoffset, "mac-address", bd->bi_enetaddr,
+					sizeof(uchar) * 6);
+	if (ret < 0)
+		printf("ft_blob_update): cannot set /soc/cpm/ethernet/mac-address "
+			"property err:%s\n", fdt_strerror(ret));
+	}
+	else {
+		/* memory node is required in dts */
+		printf("ft_blob_update(): cannot find /soc/cpm/ethernet node "
+		"err:%s\n", fdt_strerror(nodeoffset));

Ditto.

Quoted 5 lines
board/muas3001/muas3001.c new file +5 -0
+
+	/* brg clock */
+	nodeoffset = fdt_path_offset (blob, "/soc/cpm/brg");
+	if (nodeoffset >= 0) {
+		freq = cpu_to_be32(bd->bi_brgfreq);

board/muas3001/muas3001.c line 361

Quoted 10 lines
board/muas3001/muas3001.c new file +10 -0
+		ret = fdt_setprop(blob, nodeoffset, "clock-frequency", &freq,
+					sizeof(unsigned long));
+	if (ret < 0)
+		printf("ft_blob_update): cannot set /soc/cpm/brg/clock-frequency "
+			"property err:%s\n", fdt_strerror(ret));
+	}
+	else {
+		/* memory node is required in dts */
+		printf("ft_blob_update(): cannot find /soc/cpm/brg/clock-frequency node "
+		"err:%s\n", fdt_strerror(nodeoffset));

Ditto.

board/muas3001/muas3001.c line 365

Quoted 3 lines
board/muas3001/muas3001.c new file +3 -0
+
+	/* baudrate */
+	nodeoffset = fdt_path_offset (blob, "/soc/cpm/serial");

------------------------------------^^ Space

Review

Quoted 2 lines
(quoted diff) +2 -0
+	if (nodeoffset >= 0) {
+		speed = cpu_to_be32(bd->bi_baudrate);

----------------------------------^^ No Space

Your coding style is inconsistent - either do a space between function name, or don't, but please do not mix styles.

Quoted 6 lines
board/muas3001/muas3001.c new file +1 -0
+#endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
include/configs/muas3001.h new file +0 -0
new file mode 100644
index 0000000..f915e55

...

Quoted 1 line

+//# define CFG_CPMFCR_RAMTYPE (CPMFCR_DTB | CPMFCR_BDB)

C++ Comments are not allowed.

include/configs/muas3001.h line 141

Quoted 6 lines
include/configs/muas3001.h new file +6 -0
+#define CONFIG_EXTRA_ENV_SETTINGS						\
+	"netdev=eth0\0"								\
+	"u-boot_addr=100000\0"							\
+	"kernel_addr=200000\0"							\
+	"fdt_addr=400000\0"							\
+	"rootpath=/opt/eldk-4.2-2008-04-01/ppc_82xx\0"				\

Does the code work only with this specific version of the ELDK? I don't think so. I suggest to change this into /opt/eldk/ppc_6xx instead.

include/configs/muas3001.h line 144

Quoted 3 lines
include/configs/muas3001.h new file +3 -0
+	"u-boot=u-boot.bin\0"						\
+	"bootfile=uImage\0"						\
+	"fdt_file=muas3001.dtb\0"					\

Standard is to have a board directory, i. e. "muas3001/u-boot.bin" etc.

include/configs/muas3001.h line 145

Quoted 1 line
include/configs/muas3001.h new file +1 -0
+	"kernel_file=uImage\0"					\

What's the difference between kernel_file and bootfile ?

Quoted 16 lines
include/configs/muas3001.h new file +16 -0
+	"ramdisk_file=uRamdisk\0"					\
+	"load=tftp ${u-boot_addr} ${u-boot}\0"					\
+	"update=prot off ff000000 ff03ffff; era ff000000 ff03ffff; "		\
+		"cp.b ${u-boot_addr} ff000000 ${filesize};"			\
+		"prot on ff000000 ff03ffff\0"					\
+	"ramargs=setenv bootargs root=/dev/ram rw\0"				\
+	"nfsargs=setenv bootargs root=/dev/nfs rw "				\
+		"nfsroot=${serverip}:${rootpath}\0"				\
+	"addcons=setenv bootargs ${bootargs} console=ttyCPM0,${baudrate}\0"	\
+	"addmtd=setenv bootargs ${bootargs} ${mtdparts}\0"			\
+	"addip=setenv bootargs ${bootargs} "					\
+		"ip=${ipaddr}:${serverip}:${gatewayip}:"			\
+		"${netmask}:${hostname}:${netdev}:off panic=1\0"		\
+	"net_nfs=tftp ${kernel_addr} ${bootfile}; "				\
+		"tftp ${fdt_addr} ${fdt_file}; run nfsargs addip addcons;"	\
+		"bootm ${kernel_addr} - ${fdt_addr}\0"				\

include/configs/muas3001.h line 171

Quoted 10 lines
include/configs/muas3001.h new file +10 -0
+	"net_self=tftp ${kernel_addr} ${bootfile}; "				\
+		"tftp ${fdt_addr} ${fdt_file}; "				\
+		"tftp ${ramdisk_addr} ${ramdisk_file}; "			\
+		"run ramargs addip; "						\
+		"bootm ${kernel_addr} ${ramdisk_addr} ${fdt_addr}\0"		\
+	"ramdisk_addr=ff210000\0"						\
+	"kernel_addr_self=ff050000\0"						\
+	"fdt_addr_self=ff200000\0"						\
+	"flash_self=run ramargs addip addcons;bootm ${kernel_addr_self}"	\
+	" ${ramdisk_addr} ${fdt_addr_self}\0"					\

"Standard" names are "kernel_addr", "ramdisk_addr" and "fdt_addr" in flash, and "kernel_addr_r", "ramdisk_addr_r" and "fdt_addr_r" in RAM. See for example TQM5200.

include/configs/muas3001.h line 178

Quoted 7 lines
include/configs/muas3001.h new file +7 -0
+	"updateramdisk=era ${ramdisk_addr} +1f0000;tftpb ${kernel_addr} ${ramdisk_file};"	\
+	"cp.b ${kernel_addr} ${ramdisk_addr} ${filesize}\0"					\
+	"updatekernel=era ${kernel_addr_self} +1b0000;tftpb ${kernel_addr} ${kernel_file};"	\
+	"cp.b ${kernel_addr} ${kernel_addr_self} ${filesize}\0"					\
+	"updatefdt=era ${fdt_addr_self} +10000;tftpb ${fdt_addr} ${fdt_file};"		\
+	"cp.b ${fdt_addr} ${fdt_addr_self} ${filesize}\0"					\
+	""

Maximum line length exceeded.

Best regards,

Wolfgang Denk

Signature · 6 lines
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: wd at denx.de
As far as the laws of mathematics refer to reality, they are not cer-
tain, and as far as they are certain, they do not refer  to  reality.
                                                   -- Albert Einstein