Apollon UBI support
PATCH 1/1 Apollon UBI support
If you want to UBI on Apollon, uncomment the CONFIG_SYS_USE_UBI macro
--- board/apollon/Makefile | 4 ++- board/apollon/ubi.c | 55 +++++++++++++++++++++++++++++++++++++++++++++ include/configs/apollon.h | 27 +++++++++++++++++++-- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 board/apollon/ubi.c
board/apollon/Makefile +3 -1
@@ -25,9 +25,11 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a -COBJS := apollon.o mem.o sys_info.o +COBJS-y := apollon.o mem.o sys_info.o +COBJS-$(CONFIG_CMD_UBI) += ubi.o SOBJS := lowlevel_init.o +COBJS := $(COBJS-y) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) SOBJS := $(addprefix $(obj),$(SOBJS))
board/apollon/ubi.c new file +55 -0
55 lines not on this page · raw message
include/configs/apollon.h +24 -3
@@ -53,6 +53,9 @@#define CONFIG_SYS_USE_NOR 1#endif +/* uncommnet if you want to use UBI */ +#define CONFIG_SYS_USE_UBI +#include <asm/arch/omap2420.h> /* get chip and board defs */ #define V_SCLK 12000000
@@ -73,7 +76,7 @@* Size of malloc() pool */ #define CONFIG_ENV_SIZE SZ_128K/* Total Size of Environment Sector */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + SZ_128K) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + SZ_1M)#define CONFIG_SYS_GBL_DATA_SIZE 128/* bytes reserved for initial data */ /*
@@ -116,6 +119,12 @@#define CONFIG_CMD_DIAG #define CONFIG_CMD_ONENAND +#ifdef CONFIG_SYS_USE_UBI +#define CONFIG_CMD_JFFS2 +#define CONFIG_CMD_UBI +#define CONFIG_RBTREE +#endif +#undef CONFIG_CMD_AUTOSCRIPT#ifndef CONFIG_SYS_USE_NOR
@@ -134,9 +143,9 @@#define CONFIG_ETHADDR 00:0E:99:00:24:20#ifdef CONFIG_APOLLON_PLUS -# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"#else -# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"#endif #define CONFIG_EXTRA_ENV_SETTINGS \
@@ -151,6 +160,7 @@"oneboot=onenand read 0x80008000 0x40000 0x200000; go 0x80008000\0" \"onesyncboot=run syncmode oneboot\0" \"updateb=tftp 0x80180000 u-boot-onenand.bin; onenand erase 0x0 0x20000; onenand write 0x80180000 0x0 0x20000\0" \ +"ubi=setenv bootargs ${bootargs} ubi.mtd=4 ${mtdparts}; run uImage\0" \"bootcmd=run uboot\0" /*
@@ -228,4 +238,15 @@#define CONFIG_ENV_IS_IN_ONENAND 1#define CONFIG_ENV_ADDR 0x00020000 +#ifdef CONFIG_SYS_USE_UBI +#define CONFIG_JFFS2_CMDLINE +#define MTDIDS_DEFAULT "onenand0=onenand" +#define MTDPARTS_DEFAULT "mtdparts=onenand:128k(bootloader)," \ + "128k(params)," \ + "2m(kernel)," \ + "16m(rootfs)," \ + "32m(fs)," \ + "-(ubifs)" +#endif +#endif /* __CONFIG_H */
Signature · 1 line
1.5.3.3
PATCH 1/1 Apollon UBI support
Quoted 37 lines · Kyungmin Park
If you want to UBI on Apollon, uncomment the
CONFIG_SYS_USE_UBImacroSigned-off-by Kyungmin Park <[email protected]>--- board/apollon/Makefile | 4 ++- board/apollon/ubi.c | 55 +++++++++++++++++++++++++++++++++++++++++++++ include/configs/apollon.h | 27 +++++++++++++++++++-- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 board/apollon/ubi.cboard/apollon/Makefile +3
-1@@ -25,9 +25,11 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a -COBJS := apollon.o mem.o sys_info.o +COBJS-y := apollon.o mem.o sys_info.o +COBJS-$(CONFIG_CMD_UBI) += ubi.o SOBJS := lowlevel_init.o +COBJS := $(COBJS-y) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) SOBJS := $(addprefix $(obj),$(SOBJS))board/apollon/ubi.c new file +4
-0@@ -0,0 +1,55 @@ +/* +* board/apollon/ubi.c +*/ +
board/apollon/ubi.c line 14
Quoted 10 lines
board/apollon/ubi.c new file +10
-0+#include <common.h> +#include <linux/mtd/mtd.h> +#include <linux/mtd/partitions.h> +#include <jffs2/load_kernel.h> +#include <ubi_uboot.h> + +/* common/cmd_jffs2.c */ +extern int mtdparts_init (void ); +extern int find_dev_and_part (const char *id,struct mtd_device **dev, +u8 *part_num,struct part_info **part);
^^^^^^^^^^^^^^^^
whitespace please fix
It will be better to have it in a header?
board/apollon/ubi.c line 18
Quoted 4 lines
board/apollon/ubi.c new file +4
-0+ +/* drivers/mtd/ubi/build.c */ +extern int ubi_mtd_param_parse (const char *val,struct kernel_param *kp); +extern int ubi_init (void );
It will be better to have it in a header?
board/apollon/ubi.c line 20
Quoted 2 lines
board/apollon/ubi.c new file +2
-0+ +#ifdef CONFIG_CMD_UBI
please move this to the Makefile
board/apollon/ubi.c line 24
Quoted 4 lines
board/apollon/ubi.c new file +4
-0+ +int ubi_board_scan (void ) +{ +struct mtd_device *dev;
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 25
Quoted 1 line
board/apollon/ubi.c new file +1
-0+struct part_info *part;
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 26
Quoted 1 line
board/apollon/ubi.c new file +1
-0+struct mtd_partition mtd_part;
whitespace please fix
^^^^^^^^
board/apollon/ubi.c line 27
Quoted 1 line
board/apollon/ubi.c new file +1
-0+char buffer[32 ];
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 28
Quoted 1 line
board/apollon/ubi.c new file +1
-0+u8 pnum;
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 29
Quoted 1 line
board/apollon/ubi.c new file +1
-0+int err;
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 31
Quoted 2 lines
board/apollon/ubi.c new file +2
-0+ +if (mtdparts_init () !=0 )
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 32
Quoted 1 line
board/apollon/ubi.c new file +1
-0+return 1 ;
^^^^^^^^^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 34
Quoted 2 lines
board/apollon/ubi.c new file +2
-0+ +if (find_dev_and_part ("onenand0,4" , &dev, &pnum, &part) !=0 )
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 35
Quoted 1 line
board/apollon/ubi.c new file +1
-0+return 1 ;
^^^^^^^^^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 37
Quoted 2 lines
board/apollon/ubi.c new file +2
-0+ +printf ("%s[%d] pnum %d\n" , __func__, __LINE__, pnum);
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 38
Quoted 1 line
board/apollon/ubi.c new file +1
-0+sprintf (buffer,"mtd=%d" , pnum);
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 39
Quoted 1 line
board/apollon/ubi.c new file +1
-0+ mtd_part.name = buffer;
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 40
Quoted 1 line
board/apollon/ubi.c new file +1
-0+ mtd_part.size = part->size;
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 41
Quoted 1 line
board/apollon/ubi.c new file +1
-0+ mtd_part.offset = part->offset;
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 42
Quoted 1 line
board/apollon/ubi.c new file +1
-0+add_mtd_partitions (&onenand_mtd, &mtd_part,1 );
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 44
Quoted 2 lines
board/apollon/ubi.c new file +2
-0+ + err =ubi_mtd_param_parse (buffer,NULL );
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 45
Quoted 1 line
board/apollon/ubi.c new file +1
-0+if (err)
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 46
Quoted 1 line
board/apollon/ubi.c new file +1
-0+return err;
whitespace please fix
board/apollon/ubi.c line 48
Quoted 2 lines
board/apollon/ubi.c new file +2
-0+ + err =ubi_init ();
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 49
Quoted 1 line
board/apollon/ubi.c new file +1
-0+if (err)
^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 50
Quoted 1 line
board/apollon/ubi.c new file +1
-0+return err;
^^^^^^^^^^^^^^^^
whitespace please fix
board/apollon/ubi.c line 52
Quoted 2 lines
board/apollon/ubi.c new file +2
-0+ +return 0 ;
^^^^^^^^
whitespace please fix
include/configs/apollon.h line 56
Quoted 12 lines
board/apollon/ubi.c new file +3
-0+} + +#endif include/configs/apollon.h +1
-0@@ -53,6 +53,9 @@#define CONFIG_SYS_USE_NOR 1#endif +/* uncommnet if you want to use UBI */
????
Quoted 28 lines
include/configs/apollon.h +9
-1+#define CONFIG_SYS_USE_UBI +#include <asm/arch/omap2420.h> /* get chip and board defs */ #define V_SCLK 12000000@@ -73,7 +76,7 @@* Size of malloc() pool */ #define CONFIG_ENV_SIZE SZ_128K/* Total Size of Environment Sector */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + SZ_128K) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + SZ_1M)#define CONFIG_SYS_GBL_DATA_SIZE 128/* bytes reserved for initial data */ /* @@ -116,6 +119,12 @@#define CONFIG_CMD_DIAG #define CONFIG_CMD_ONENAND +#ifdef CONFIG_SYS_USE_UBI +#define CONFIG_CMD_JFFS2 +#define CONFIG_CMD_UBI +#define CONFIG_RBTREE +#endif +#undef CONFIG_CMD_AUTOSCRIPT#ifndef CONFIG_SYS_USE_NOR
include/configs/apollon.h line 146
Quoted 5 lines
include/configs/apollon.h +1
-1@@ -134,9 +143,9 @@#define CONFIG_ETHADDR 00:0E:99:00:24:20#ifdef CONFIG_APOLLON_PLUS -# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"
too long please split
include/configs/apollon.h line 148
Quoted 3 lines
include/configs/apollon.h +1
-1#else -# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"
ditto
include/configs/apollon.h line 162
Quoted 7 lines
include/configs/apollon.h +0
-0#endif #define CONFIG_EXTRA_ENV_SETTINGS \@@ -151,6 +160,7 @@"oneboot=onenand read 0x80008000 0x40000 0x200000; go 0x80008000\0" \"onesyncboot=run syncmode oneboot\0" \"updateb=tftp 0x80180000 u-boot-onenand.bin; onenand erase 0x0 0x20000; onenand write 0x80180000 0x0 0x20000\0" \
ditto
Quoted 11 lines
include/configs/apollon.h +3
-0+"ubi=setenv bootargs ${bootargs} ubi.mtd=4 ${mtdparts}; run uImage\0" \"bootcmd=run uboot\0" /* @@ -228,4 +238,15 @@#define CONFIG_ENV_IS_IN_ONENAND 1#define CONFIG_ENV_ADDR 0x00020000 +#ifdef CONFIG_SYS_USE_UBI +#define CONFIG_JFFS2_CMDLINE
include/configs/apollon.h line 252
Quoted 10 lines
include/configs/apollon.h +9
-0+#define MTDIDS_DEFAULT "onenand0=onenand" +#define MTDPARTS_DEFAULT "mtdparts=onenand:128k(bootloader)," \ + "128k(params)," \ + "2m(kernel)," \ + "16m(rootfs)," \ + "32m(fs)," \ + "-(ubifs)" +#endif +#endif /* __CONFIG_H */
Best Regards,
J.
PATCH 1/1 Apollon UBI support
In reply to Kyungmin ParkDear Kyungmin Park,
Quoted 9 lines · In message <20081021091908.GA29310@july> you wrote:
If you want to UBI on Apollon, uncomment the
CONFIG_SYS_USE_UBImacroSigned-off-by Kyungmin Park <[email protected]>--- board/apollon/Makefile | 4 ++- board/apollon/ubi.c | 55 +++++++++++++++++++++++++++++++++++++++++++++ include/configs/apollon.h | 27 +++++++++++++++++++-- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 board/apollon/ubi.c
...
Quoted 15 lines
include/configs/apollon.h +3
-0@@ -53,6 +53,9 @@#define CONFIG_SYS_USE_NOR 1#endif +/* uncommnet if you want to use UBI */ +#define CONFIG_SYS_USE_UBI +#include <asm/arch/omap2420.h> /* get chip and board defs */ #define V_SCLK 12000000
include/configs/apollon.h line 80
Quoted 6 lines
include/configs/apollon.h +1
-1@@ -73,7 +76,7 @@* Size of malloc() pool */ #define CONFIG_ENV_SIZE SZ_128K/* Total Size of Environment Sector */ -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + SZ_128K) +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + SZ_1M)#define CONFIG_SYS_GBL_DATA_SIZE 128/* bytes reserved for initial data */
Maximum line length exceeded.
Quoted 15 lines
include/configs/apollon.h +6
-0/* @@ -116,6 +119,12 @@#define CONFIG_CMD_DIAG #define CONFIG_CMD_ONENAND +#ifdef CONFIG_SYS_USE_UBI +#define CONFIG_CMD_JFFS2 +#define CONFIG_CMD_UBI +#define CONFIG_RBTREE +#endif +#undef CONFIG_CMD_AUTOSCRIPT#ifndef CONFIG_SYS_USE_NOR
include/configs/apollon.h line 148
Quoted 8 lines
include/configs/apollon.h +2
-2@@ -134,9 +143,9 @@#define CONFIG_ETHADDR 00:0E:99:00:24:20#ifdef CONFIG_APOLLON_PLUS -# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"#else -# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"
Maximum line length exceeded.
And please do not hard-code network parameters into U-Boot.
include/configs/apollon.h line 163
Quoted 8 lines
include/configs/apollon.h +1
-0#endif #define CONFIG_EXTRA_ENV_SETTINGS \@@ -151,6 +160,7 @@"oneboot=onenand read 0x80008000 0x40000 0x200000; go 0x80008000\0" \"onesyncboot=run syncmode oneboot\0" \"updateb=tftp 0x80180000 u-boot-onenand.bin; onenand erase 0x0 0x20000; onenand write 0x80180000 0x0 0x20000\0" \ +"ubi=setenv bootargs ${bootargs} ubi.mtd=4 ${mtdparts}; run uImage\0" \
Please also fix too long line above.
Best regards,
Wolfgang Denk
Signature · 7 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 "One day," said a dull voice from down below, "I'm going to be back in form again and you're going to be very sorry you said that. For a very long time. I might even go so far as to make even more Time just for you to be sorry in." - Terry Pratchett, _Small Gods_
PATCH 1/1 Apollon UBI support
Dear Wolfgang,
Quoted 8 lines
include/configs/apollon.h line 148
Quoted 5 lines
include/configs/apollon.h +2
-2-# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"#else -# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"Maximum line length exceeded.
Fixed all commented except one.
I run the checkpatch.pl and passed.
Quoted 2 lines
And please do not hard-code network parameters into U-Boot.
Then how to define the network IP at bootargs? please give some example?
Thank you,
Kyungmin Park
PATCH 1/1 Apollon UBI support
Hi Kyungmin,
Quoted 17 lines · Kyungmin Park
Dear Wolfgang,
Quoted 9 lines
include/configs/apollon.h line 148
Quoted 6 lines
include/configs/apollon.h +2
-2-# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=64M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"#else -# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2" +# define CONFIG_BOOTARGS "root=/dev/nfs rw mem=128M console=ttyS0,115200n8 ip=192.168.116.25:192.168.116.1:192.168.116.1:255.255.255.0:apollon:eth0:off nfsroot=/tftpboot/nfsroot profile=2 lpj=1646592 ubi.mtd=4"Maximum line length exceeded.
Fixed all commented except one.
I run the checkpatch.pl and passed.
Quoted 6 lines
Quoted 3 lines
And please do not hard-code network parameters into U-Boot.
Then how to define the network IP at bootargs? please give some example?
You set environment variables (ie. setenv bootcmd ...)
regards,
Ben