Project

General

Profile

Flashing a new kernel to NOR from Linux rather than u-boot

Added by Fred Weiser over 8 years ago

We use opkg to push updates to our products that are installed in the field. We now need a way to update the kernel, which is saved in NOR on the MityDSP-l138 som. A search of the CL wiki shows:

flashcp -v uImage /dev/mtd7

We have the tool in our rootfs, however, the kernel we are using was apparently compiled without the CONFIG_MTD_CHAR flag set, so we do not have the /dev/mtdx entries. We do not have physical access to the target in the field, only network access, so using u-boot is not an option.

I need a way out of this chicken/egg problem; are there any other tools/ways to flash the kernel into NOR from linux? --Thanks.


Replies (3)

RE: Flashing a new kernel to NOR from Linux rather than u-boot - Added by Jonathan Cormier over 8 years ago

Fred,

Do you have /dev/mtdblock* devices? My kernel boot args have this "root=/dev/mtdblock0", so my assumption is that you will need to have the mtdblocks enabled inorder to boot from nand.

If you do have the mtdblock devices it may be possible to use that to write a new kernel. I've never tried this before but I think you would use "dd if=uImage of=/dev/mtdblock7" to copy the uImage file into the appropriate mtdblock. Though I recommend you try this on a unit you have physical access to first.

Please read this for a description of the mtd and mtdblock interfaces. http://www.linux-mtd.infradead.org/faq/general.html

If you could include the output of these commands it may be helpful. I've attached mine below:

root@mityomapl138:~# uname -a
Linux mityomapl138 3.2.0+ #16 PREEMPT Thu Feb 19 14:56:13 EST 2015 armv5tejl GNU/Linux
root@mityomapl138:~# zcat /proc/config.gz | grep MTD
CONFIG_MTD=y
# CONFIG_MTD_TESTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y
# CONFIG_MTD_AFS_PARTS is not set
# CONFIG_MTD_AR7_PARTS is not set
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
# CONFIG_MTD_OOPS is not set
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PLATRAM is not set
# Self-contained MTD device drivers
# CONFIG_MTD_DATAFLASH is not set
CONFIG_MTD_M25P80=y
# CONFIG_MTD_SST25L is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
# CONFIG_MTD_DOCG3 is not set
CONFIG_MTD_NAND_ECC=y
# CONFIG_MTD_NAND_ECC_SMC is not set
CONFIG_MTD_NAND=y
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
# CONFIG_MTD_NAND_ECC_BCH is not set
# CONFIG_MTD_SM_COMMON is not set
# CONFIG_MTD_NAND_MUSEUM_IDS is not set
# CONFIG_MTD_NAND_GPIO is not set
CONFIG_MTD_NAND_IDS=y
# CONFIG_MTD_NAND_DISKONCHIP is not set
# CONFIG_MTD_NAND_NANDSIM is not set
# CONFIG_MTD_NAND_PLATFORM is not set
# CONFIG_MTD_ALAUDA is not set
CONFIG_MTD_NAND_DAVINCI=y
# CONFIG_MTD_ONENAND is not set
# CONFIG_MTD_LPDDR is not set
# CONFIG_MTD_UBI is not set

RE: Flashing a new kernel to NOR from Linux rather than u-boot - Added by Jonathan Cormier over 8 years ago

Alternatively it may be possible for you to build the kernel features as modules and insert them in the live system. Would like to see the output of the commands mentioned above first.

RE: Flashing a new kernel to NOR from Linux rather than u-boot - Added by Fred Weiser over 8 years ago

Here are the results from my board/MDK:

Linux ultrasonic 3.2.0 #2 PREEMPT Fri Mar 15 10:29:39 EDT 2013 armv5tejl GNU/Linux
CONFIG_MTD=y
# CONFIG_MTD_TESTS is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
CONFIG_MTD_CMDLINE_PARTS=y
# CONFIG_MTD_AFS_PARTS is not set
# CONFIG_MTD_AR7_PARTS is not set
# CONFIG_MTD_CHAR is not set
CONFIG_MTD_BLKDEVS=y
CONFIG_MTD_BLOCK=y
# CONFIG_MTD_OOPS is not set
# CONFIG_MTD_CFI is not set
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_MAP_BANK_WIDTH_1=y
CONFIG_MTD_MAP_BANK_WIDTH_2=y
CONFIG_MTD_MAP_BANK_WIDTH_4=y
# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
CONFIG_MTD_CFI_I1=y
CONFIG_MTD_CFI_I2=y
# CONFIG_MTD_CFI_I4 is not set
# CONFIG_MTD_CFI_I8 is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_COMPLEX_MAPPINGS is not set
# CONFIG_MTD_PLATRAM is not set
# Self-contained MTD device drivers
# CONFIG_MTD_DATAFLASH is not set
CONFIG_MTD_M25P80=y
# CONFIG_MTD_SST25L is not set
# CONFIG_MTD_SLRAM is not set
# CONFIG_MTD_PHRAM is not set
# CONFIG_MTD_MTDRAM is not set
# CONFIG_MTD_BLOCK2MTD is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
# CONFIG_MTD_DOCG3 is not set
CONFIG_MTD_NAND_ECC=y
# CONFIG_MTD_NAND_ECC_SMC is not set
CONFIG_MTD_NAND=y
# CONFIG_MTD_NAND_VERIFY_WRITE is not set
# CONFIG_MTD_NAND_ECC_BCH is not set
# CONFIG_MTD_SM_COMMON is not set
# CONFIG_MTD_NAND_MUSEUM_IDS is not set
# CONFIG_MTD_NAND_GPIO is not set
CONFIG_MTD_NAND_IDS=y
# CONFIG_MTD_NAND_DISKONCHIP is not set
# CONFIG_MTD_NAND_NANDSIM is not set
# CONFIG_MTD_NAND_PLATFORM is not set
# CONFIG_MTD_ALAUDA is not set
CONFIG_MTD_NAND_DAVINCI=y
# CONFIG_MTD_ONENAND is not set
# CONFIG_MTD_LPDDR is not set
# CONFIG_MTD_UBI is not set

I will try the dd command later today... --Thanks

    (1-3/3)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)