* [PATCH 1/4] ARM: mini2440: switch to env2
2014-05-18 14:46 [PATCH 0/4] some mini2440 updates Michael Olbrich
@ 2014-05-18 14:46 ` Michael Olbrich
2014-05-18 14:46 ` [PATCH 2/4] ARM: mini2440: update defconfig Michael Olbrich
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Michael Olbrich @ 2014-05-18 14:46 UTC (permalink / raw)
To: barebox; +Cc: Michael Olbrich
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
arch/arm/boards/friendlyarm-mini2440/env/boot/nand | 9 ++++
arch/arm/boards/friendlyarm-mini2440/env/config | 54 ----------------------
.../boards/friendlyarm-mini2440/env/config-board | 16 +++++++
.../friendlyarm-mini2440/env/init/mtdparts-nand | 11 +++++
arch/arm/mach-samsung/Kconfig | 1 +
5 files changed, 37 insertions(+), 54 deletions(-)
create mode 100644 arch/arm/boards/friendlyarm-mini2440/env/boot/nand
delete mode 100644 arch/arm/boards/friendlyarm-mini2440/env/config
create mode 100644 arch/arm/boards/friendlyarm-mini2440/env/config-board
create mode 100644 arch/arm/boards/friendlyarm-mini2440/env/init/mtdparts-nand
diff --git a/arch/arm/boards/friendlyarm-mini2440/env/boot/nand b/arch/arm/boards/friendlyarm-mini2440/env/boot/nand
new file mode 100644
index 0000000..3037fd4
--- /dev/null
+++ b/arch/arm/boards/friendlyarm-mini2440/env/boot/nand
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+ boot-menu-add-entry "$0" "nand (UBI)"
+ exit
+fi
+
+global.bootm.image="/dev/nand0.kernel.bb"
+global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"
diff --git a/arch/arm/boards/friendlyarm-mini2440/env/config b/arch/arm/boards/friendlyarm-mini2440/env/config
deleted file mode 100644
index f060aae..0000000
--- a/arch/arm/boards/friendlyarm-mini2440/env/config
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-eth0.serverip=
-user=
-
-# use 'dhcp' to do dhcp in barebox and in kernel
-# use 'none' if you want to skip kernel ip autoconfiguration
-ip=dhcp
-
-# or set your networking parameters here
-#eth0.ipaddr=a.b.c.d
-#eth0.netmask=a.b.c.d
-#eth0.gateway=a.b.c.d
-#eth0.serverip=a.b.c.d
-
-# can be either 'nfs', 'tftp' or 'nand'
-kernel_loc=tftp
-# can be either 'net', 'nand' or 'initrd'
-rootfs_loc=net
-
-# can be either 'jffs2' or 'ubifs'
-rootfs_type=ubifs
-rootfsimage=root-${global.hostname}.${rootfs_type}
-
-kernelimage=zImage-${global.hostname}
-#kernelimage=uImage-${global.hostname}
-#kernelimage=Image-${global.hostname}
-#kernelimage=Image-${global.hostname}.lzo
-
-if [ -n $user ]; then
- kernelimage="${user}"-"${kernelimage}"
- nfsroot="${eth0.serverip}:/home/${user}/nfsroot/${global.hostname}"
- rootfsimage="${user}"-"${rootfsimage}"
-else
- nfsroot="${eth0.serverip}:/path/to/nfs/root"
-fi
-
-autoboot_timeout=3
-
-#
-# "mini2440" kernel parameter
-# 0 .. 9 = screen type
-# b = backlight enabled
-# t = touch enabled
-# c = camera enabled
-# Note: can be "minit2440= " if nothing of these components are connected
-#
-bootargs="console=ttySAC0,115200 mini2440=0tbc"
-
-# TODO NOR support
-
-nand_device="nand"
-nand_parts="256k(barebox),128k(bareboxenv),1536k(kernel),-(root)"
-rootfs_mtdblock_nand=3
diff --git a/arch/arm/boards/friendlyarm-mini2440/env/config-board b/arch/arm/boards/friendlyarm-mini2440/env/config-board
new file mode 100644
index 0000000..3e07a01
--- /dev/null
+++ b/arch/arm/boards/friendlyarm-mini2440/env/config-board
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# board defaults, do not change in running system. Change /env/config
+# instead
+
+global.linux.bootargs.console="console=ttySAC0,115200"
+
+#
+# "mini2440" kernel parameter
+# 0 .. 9 = screen type
+# b = backlight enabled
+# t = touch enabled
+# c = camera enabled
+# Note: can be "minit2440= " if nothing of these components are connected
+#
+global.linux.bootargs.base="mini2440=6tb"
diff --git a/arch/arm/boards/friendlyarm-mini2440/env/init/mtdparts-nand b/arch/arm/boards/friendlyarm-mini2440/env/init/mtdparts-nand
new file mode 100644
index 0000000..7271341
--- /dev/null
+++ b/arch/arm/boards/friendlyarm-mini2440/env/init/mtdparts-nand
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ "$1" = menu ]; then
+ init-menu-add-entry "$0" "NAND partitions"
+ exit
+fi
+
+mtdparts="256k(nand0.barebox),128k(nand0.bareboxenv),1536k(nand0.kernel),-(nand0.root)"
+kernelname="nand"
+
+mtdparts-add -b -d nand0 -k ${kernelname} -p ${mtdparts}
diff --git a/arch/arm/mach-samsung/Kconfig b/arch/arm/mach-samsung/Kconfig
index 562b392..13dac29 100644
--- a/arch/arm/mach-samsung/Kconfig
+++ b/arch/arm/mach-samsung/Kconfig
@@ -52,6 +52,7 @@ config MACH_MINI2440
select S3C_PLL_INIT
select S3C_SDRAM_INIT
select HAS_DM9000
+ select HAVE_DEFAULT_ENVIRONMENT_NEW
help
Say Y here if you are using Mini 2440 dev board equipped
with a Samsung S3C2440 Processor
--
2.0.0.rc0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/4] ARM: mini2440: update defconfig
2014-05-18 14:46 [PATCH 0/4] some mini2440 updates Michael Olbrich
2014-05-18 14:46 ` [PATCH 1/4] ARM: mini2440: switch to env2 Michael Olbrich
@ 2014-05-18 14:46 ` Michael Olbrich
2014-05-18 14:46 ` [PATCH 3/4] ARM Samsung: fix booting from NAND with pbl Michael Olbrich
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Michael Olbrich @ 2014-05-18 14:46 UTC (permalink / raw)
To: barebox; +Cc: Michael Olbrich
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
arch/arm/configs/friendlyarm_mini2440_defconfig | 34 ++++++++++++-------------
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/arch/arm/configs/friendlyarm_mini2440_defconfig b/arch/arm/configs/friendlyarm_mini2440_defconfig
index ed11014..353f1db 100644
--- a/arch/arm/configs/friendlyarm_mini2440_defconfig
+++ b/arch/arm/configs/friendlyarm_mini2440_defconfig
@@ -7,37 +7,35 @@ CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS=y
CONFIG_TEXT_BASE=0x33e00000
CONFIG_BROKEN=y
CONFIG_PROMPT="mini2440:"
-CONFIG_LONGHELP=y
-CONFIG_GLOB=y
CONFIG_CMDLINE_EDITING=y
CONFIG_AUTO_COMPLETE=y
-CONFIG_DEFAULT_ENVIRONMENT_GENERIC=y
+CONFIG_DEFAULT_ENVIRONMENT_GENERIC_NEW=y
CONFIG_DEFAULT_ENVIRONMENT_PATH="arch/arm/boards/friendlyarm-mini2440/env"
CONFIG_DEBUG_INFO=y
-CONFIG_CMD_EDIT=y
-CONFIG_CMD_SLEEP=y
-CONFIG_CMD_SAVEENV=y
-CONFIG_CMD_LOADENV=y
-CONFIG_CMD_EXPORT=y
-CONFIG_CMD_PRINTENV=y
-CONFIG_CMD_READLINE=y
+CONFIG_LONGHELP=y
CONFIG_CMD_MEMINFO=y
-CONFIG_CMD_MTEST=y
-CONFIG_CMD_FLASH=y
-CONFIG_CMD_RESET=y
CONFIG_CMD_GO=y
-CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_RESET=y
CONFIG_CMD_PARTITION=y
-CONFIG_CMD_GPIO=y
-CONFIG_NET=y
+CONFIG_CMD_EXPORT=y
+CONFIG_CMD_LOADENV=y
+CONFIG_CMD_PRINTENV=y
+CONFIG_CMD_SAVEENV=y
+CONFIG_CMD_SLEEP=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_PING=y
CONFIG_CMD_TFTP=y
-CONFIG_FS_TFTP=y
+CONFIG_CMD_EDIT=y
+CONFIG_CMD_READLINE=y
+CONFIG_CMD_TIMEOUT=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_FLASH=y
+CONFIG_CMD_GPIO=y
+CONFIG_NET=y
CONFIG_DRIVER_NET_DM9K=y
# CONFIG_SPI is not set
CONFIG_USB=y
CONFIG_USB_OHCI=y
-CONFIG_DRIVER_VIDEO_S3C24XX=y
CONFIG_MCI=y
CONFIG_MCI_S3C=y
+CONFIG_FS_TFTP=y
--
2.0.0.rc0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/4] ARM Samsung: fix booting from NAND with pbl
2014-05-18 14:46 [PATCH 0/4] some mini2440 updates Michael Olbrich
2014-05-18 14:46 ` [PATCH 1/4] ARM: mini2440: switch to env2 Michael Olbrich
2014-05-18 14:46 ` [PATCH 2/4] ARM: mini2440: update defconfig Michael Olbrich
@ 2014-05-18 14:46 ` Michael Olbrich
2014-05-18 14:46 ` [PATCH 4/4] net: dm9k: only read on packet for each call to dm9k_eth_rx() Michael Olbrich
2014-05-19 7:46 ` [PATCH 0/4] some mini2440 updates Sascha Hauer
4 siblings, 0 replies; 6+ messages in thread
From: Michael Olbrich @ 2014-05-18 14:46 UTC (permalink / raw)
To: barebox; +Cc: Michael Olbrich
The ARM pbl is linked at (TEXT_BASE - SZ_2M). This conflicts with the temporary
stack used in s3c24x0_nand_boot. Moving the stack to (TEXT_BASE - SZ_2M) fixes
this problem. With this patch a compressed barebox with pbl can boot on
mini2440 from NAND.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
This seems to work with and without a pbl, but isn't really nice. Is there
a better address that could be used here?
arch/arm/mach-samsung/lowlevel-s3c24x0.S | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-samsung/lowlevel-s3c24x0.S b/arch/arm/mach-samsung/lowlevel-s3c24x0.S
index b59ba67..e2efd86 100644
--- a/arch/arm/mach-samsung/lowlevel-s3c24x0.S
+++ b/arch/arm/mach-samsung/lowlevel-s3c24x0.S
@@ -15,6 +15,7 @@
*/
#include <config.h>
+#include <sizes.h>
#include <mach/s3c-iomap.h>
.section ".text_bare_init.s3c24x0_disable_wd","ax"
@@ -258,7 +259,7 @@ s3c24x0_nand_boot:
beq 2f
mov pc, lr /* NOR case: nothing to do here */
-2: ldr sp, =TEXT_BASE /* Setup a temporary stack in SDRAM */
+2: ldr sp, =(TEXT_BASE - SZ_2M) /* Setup a temporary stack in SDRAM */
/*
* We still run at a location we are not linked to. But lets still running
* from the internal SRAM, this may speed up the boot
@@ -269,7 +270,7 @@ s3c24x0_nand_boot:
/*
* Adjust the return address to the correct address in SDRAM
*/
- ldr r1, =TEXT_BASE
+ ldr r1, =(TEXT_BASE - SZ_2M)
add lr, lr, r1
mov pc, lr
--
2.0.0.rc0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/4] net: dm9k: only read on packet for each call to dm9k_eth_rx()
2014-05-18 14:46 [PATCH 0/4] some mini2440 updates Michael Olbrich
` (2 preceding siblings ...)
2014-05-18 14:46 ` [PATCH 3/4] ARM Samsung: fix booting from NAND with pbl Michael Olbrich
@ 2014-05-18 14:46 ` Michael Olbrich
2014-05-19 7:46 ` [PATCH 0/4] some mini2440 updates Sascha Hauer
4 siblings, 0 replies; 6+ messages in thread
From: Michael Olbrich @ 2014-05-18 14:46 UTC (permalink / raw)
To: barebox; +Cc: Michael Olbrich
Some users such as fs/nfs.c just save the pointer to the packet in the
handler and process it after net_poll() returns. This break when more than
one packet is received using the same buffer.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
drivers/net/dm9k.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dm9k.c b/drivers/net/dm9k.c
index e98b8f4..3a4c6aa 100644
--- a/drivers/net/dm9k.c
+++ b/drivers/net/dm9k.c
@@ -541,7 +541,6 @@ static int dm9k_check_for_rx_packet(struct dm9k *priv)
return 0; /* no packet */
dev_dbg(dev, "Packet present\n");
- dm9k_iow(priv, DM9K_ISR, ISR_PR); /* clear PR status latched in bit 0 */
return 1; /* packet present */
}
@@ -587,8 +586,10 @@ static int dm9k_eth_rx(struct eth_device *edev)
return 0; /* no data present */
do {
- if (!dm9k_validate_entry(priv))
+ if (!dm9k_validate_entry(priv)) {
+ dm9k_iow(priv, DM9K_ISR, ISR_PR); /* clear PR status latched in bit 0 */
return 0;
+ }
/* assume this packet is valid */
p_valid = true;
@@ -634,6 +635,7 @@ static int dm9k_eth_rx(struct eth_device *edev)
dm9k_rd(priv->buswidth, priv->iodata, priv->pckt, rx_len);
dev_dbg(dev, "passing %u bytes packet to upper layer\n", rx_len);
net_receive(edev, priv->pckt, rx_len);
+ return 0;
} else {
dev_dbg(dev, "Discarding packet\n");
dm9k_dump(priv->buswidth, priv->iodata, rx_len); /* discard packet */
--
2.0.0.rc0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] some mini2440 updates
2014-05-18 14:46 [PATCH 0/4] some mini2440 updates Michael Olbrich
` (3 preceding siblings ...)
2014-05-18 14:46 ` [PATCH 4/4] net: dm9k: only read on packet for each call to dm9k_eth_rx() Michael Olbrich
@ 2014-05-19 7:46 ` Sascha Hauer
4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2014-05-19 7:46 UTC (permalink / raw)
To: Michael Olbrich; +Cc: barebox
On Sun, May 18, 2014 at 04:46:26PM +0200, Michael Olbrich wrote:
> Hi,
>
> Some updates for the mini2440. This is based on next, is that ok?
Generally I prefer patches on master and resolve the conflicts myself.
> That's mostly relavant for the defconfig but dm9k.c has a small conflict as
> well.
Applied, thanks.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 6+ messages in thread