From 062a2fc2eadbec928b05b6cb554a311b5cd308ac Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Mon, 8 Apr 2013 17:43:28 +0200 Subject: [PATCH 01/20] commands: i2c: change 0X to 0x Signed-off-by: Jan Luebbe Signed-off-by: Sascha Hauer --- commands/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/i2c.c b/commands/i2c.c index 8370b43da..626255d61 100644 --- a/commands/i2c.c +++ b/commands/i2c.c @@ -45,7 +45,7 @@ static int do_i2c_probe(int argc, char *argv[]) if (stopaddr > 0x7F) stopaddr = 0x7F; - printf("probing i2c range 0X%02x - 0x%02x :\n", startaddr, stopaddr); + printf("probing i2c range 0x%02x - 0x%02x :\n", startaddr, stopaddr); for (addr = startaddr; addr <= stopaddr; addr++) { client.addr = addr; ret = i2c_write_reg(&client, 0x00, ®, 0); From 78b72d156da49597957f786b27f34e0231ab2f49 Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Sat, 6 Apr 2013 18:31:57 +0200 Subject: [PATCH 02/20] highbank: switch to defaultenv-2 this will allow to have boot sequence and later to use PXE Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Cc: Rob Herring Signed-off-by: Sascha Hauer --- .../boards/highbank/env/boot.d/010-ahci-boot | 1 + arch/arm/boards/highbank/env/boot.d/011-ahci | 1 + .../boards/highbank/env/boot.d/020-mmc-boot | 1 + arch/arm/boards/highbank/env/boot.d/021-mmc | 1 + arch/arm/boards/highbank/env/boot.d/030-net | 1 + .../boards/highbank/env/boot.d/031-net-eth1 | 1 + arch/arm/boards/highbank/env/boot/ahci | 21 ++++++++++++ arch/arm/boards/highbank/env/boot/ahci-boot | 21 ++++++++++++ arch/arm/boards/highbank/env/boot/mmc | 21 ++++++++++++ arch/arm/boards/highbank/env/boot/mmc-boot | 21 ++++++++++++ arch/arm/boards/highbank/env/boot/net | 18 ++++++++++ arch/arm/boards/highbank/env/boot/net-eth1 | 18 ++++++++++ arch/arm/boards/highbank/env/config | 33 ------------------- arch/arm/boards/highbank/env/config-board | 11 +++++++ arch/arm/boards/highbank/env/data/oftree | 4 +++ .../{bin/init_board => init/001-dtb-probe} | 0 arch/arm/boards/highbank/env/init/automount | 27 +++++++++++++++ arch/arm/boards/highbank/env/init/ps1 | 9 +++++ arch/arm/mach-highbank/Kconfig | 1 + 19 files changed, 178 insertions(+), 33 deletions(-) create mode 120000 arch/arm/boards/highbank/env/boot.d/010-ahci-boot create mode 120000 arch/arm/boards/highbank/env/boot.d/011-ahci create mode 120000 arch/arm/boards/highbank/env/boot.d/020-mmc-boot create mode 120000 arch/arm/boards/highbank/env/boot.d/021-mmc create mode 120000 arch/arm/boards/highbank/env/boot.d/030-net create mode 120000 arch/arm/boards/highbank/env/boot.d/031-net-eth1 create mode 100644 arch/arm/boards/highbank/env/boot/ahci create mode 100644 arch/arm/boards/highbank/env/boot/ahci-boot create mode 100644 arch/arm/boards/highbank/env/boot/mmc create mode 100644 arch/arm/boards/highbank/env/boot/mmc-boot create mode 100644 arch/arm/boards/highbank/env/boot/net create mode 100644 arch/arm/boards/highbank/env/boot/net-eth1 delete mode 100644 arch/arm/boards/highbank/env/config create mode 100644 arch/arm/boards/highbank/env/config-board create mode 100644 arch/arm/boards/highbank/env/data/oftree rename arch/arm/boards/highbank/env/{bin/init_board => init/001-dtb-probe} (100%) create mode 100644 arch/arm/boards/highbank/env/init/automount create mode 100644 arch/arm/boards/highbank/env/init/ps1 diff --git a/arch/arm/boards/highbank/env/boot.d/010-ahci-boot b/arch/arm/boards/highbank/env/boot.d/010-ahci-boot new file mode 120000 index 000000000..3672f0495 --- /dev/null +++ b/arch/arm/boards/highbank/env/boot.d/010-ahci-boot @@ -0,0 +1 @@ +../boot/ahci-boot \ No newline at end of file diff --git a/arch/arm/boards/highbank/env/boot.d/011-ahci b/arch/arm/boards/highbank/env/boot.d/011-ahci new file mode 120000 index 000000000..36b3b2815 --- /dev/null +++ b/arch/arm/boards/highbank/env/boot.d/011-ahci @@ -0,0 +1 @@ +../boot/ahci \ No newline at end of file diff --git a/arch/arm/boards/highbank/env/boot.d/020-mmc-boot b/arch/arm/boards/highbank/env/boot.d/020-mmc-boot new file mode 120000 index 000000000..85c19bbd6 --- /dev/null +++ b/arch/arm/boards/highbank/env/boot.d/020-mmc-boot @@ -0,0 +1 @@ +../boot/mmc-boot \ No newline at end of file diff --git a/arch/arm/boards/highbank/env/boot.d/021-mmc b/arch/arm/boards/highbank/env/boot.d/021-mmc new file mode 120000 index 000000000..5af95d0ac --- /dev/null +++ b/arch/arm/boards/highbank/env/boot.d/021-mmc @@ -0,0 +1 @@ +../boot/mmc \ No newline at end of file diff --git a/arch/arm/boards/highbank/env/boot.d/030-net b/arch/arm/boards/highbank/env/boot.d/030-net new file mode 120000 index 000000000..70b8ea396 --- /dev/null +++ b/arch/arm/boards/highbank/env/boot.d/030-net @@ -0,0 +1 @@ +../boot/net \ No newline at end of file diff --git a/arch/arm/boards/highbank/env/boot.d/031-net-eth1 b/arch/arm/boards/highbank/env/boot.d/031-net-eth1 new file mode 120000 index 000000000..5a30a308c --- /dev/null +++ b/arch/arm/boards/highbank/env/boot.d/031-net-eth1 @@ -0,0 +1 @@ +../boot/net-eth1 \ No newline at end of file diff --git a/arch/arm/boards/highbank/env/boot/ahci b/arch/arm/boards/highbank/env/boot/ahci new file mode 100644 index 000000000..3bdb80993 --- /dev/null +++ b/arch/arm/boards/highbank/env/boot/ahci @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + boot-menu-add-entry "$0" "AHCI" + exit +fi + +path="/mnt/ahci" + +global.bootm.image="${path}/zImage" + +. /env/data/oftree + +oftree=${path}/oftree +if [ -f $oftree ]; then + global.bootm.oftree="$oftree" +fi + +# The rootdevice may actually be mmcblk1p2 if a card +# is inserted to the back MMC slot +global.linux.bootargs.dyn.root="root=/dev/sda2" diff --git a/arch/arm/boards/highbank/env/boot/ahci-boot b/arch/arm/boards/highbank/env/boot/ahci-boot new file mode 100644 index 000000000..0064a46fc --- /dev/null +++ b/arch/arm/boards/highbank/env/boot/ahci-boot @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + boot-menu-add-entry "$0" "AHCI (UEFI boot partiton)" + exit +fi + +path="/mnt/ahci-boot" + +global.bootm.image="${path}/zImage" + +. /env/data/oftree + +oftree=${path}/oftree +if [ -f $oftree ]; then + global.bootm.oftree="$oftree" +fi + +# The rootdevice may actually be mmcblk1p2 if a card +# is inserted to the back MMC slot +global.linux.bootargs.dyn.root="root=/dev/sda2" diff --git a/arch/arm/boards/highbank/env/boot/mmc b/arch/arm/boards/highbank/env/boot/mmc new file mode 100644 index 000000000..43a04b5d6 --- /dev/null +++ b/arch/arm/boards/highbank/env/boot/mmc @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + boot-menu-add-entry "$0" "MMC slot" + exit +fi + +path="/mnt/mmc" + +global.bootm.image="${path}/zimage" + +. /env/data/oftree + +oftree=${path}/oftree +if [ -f $oftree ]; then + global.bootm.oftree="$oftree" +fi + +# The rootdevice may actually be mmcblk1p2 if a card +# is inserted to the back MMC slot +global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2" diff --git a/arch/arm/boards/highbank/env/boot/mmc-boot b/arch/arm/boards/highbank/env/boot/mmc-boot new file mode 100644 index 000000000..93cd99b68 --- /dev/null +++ b/arch/arm/boards/highbank/env/boot/mmc-boot @@ -0,0 +1,21 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + boot-menu-add-entry "$0" "MMC slot (UEFI boot partiton)" + exit +fi + +path="/mnt/mmc-boot" + +global.bootm.image="${path}/zimage" + +. /env/data/oftree + +oftree=${path}/oftree +if [ -f $oftree ]; then + global.bootm.oftree="$oftree" +fi + +# The rootdevice may actually be mmcblk1p2 if a card +# is inserted to the back MMC slot +global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2" diff --git a/arch/arm/boards/highbank/env/boot/net b/arch/arm/boards/highbank/env/boot/net new file mode 100644 index 000000000..80862cdac --- /dev/null +++ b/arch/arm/boards/highbank/env/boot/net @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + boot-menu-add-entry "$0" "network (tftp, nfs) (eth0)" + exit +fi + +ethact eth0 + +path="/mnt/tftp" + +. /env/data/oftree + +global.bootm.image="${path}/${global.user}-linux-${global.hostname}" +#global.bootm.oftree="${path}/${global.user}-oftree-${global.hostname}" +nfsroot="/home/${global.user}/nfsroot/${global.hostname}" +bootargs-ip +global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp" diff --git a/arch/arm/boards/highbank/env/boot/net-eth1 b/arch/arm/boards/highbank/env/boot/net-eth1 new file mode 100644 index 000000000..d9e9804a0 --- /dev/null +++ b/arch/arm/boards/highbank/env/boot/net-eth1 @@ -0,0 +1,18 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + boot-menu-add-entry "$0" "network (tftp, nfs) (eth1)" + exit +fi + +ethact eth1 + +path="/mnt/tftp" + +. /env/data/oftree + +global.bootm.image="${path}/${global.user}-linux-${global.hostname}" +#global.bootm.oftree="${path}/${global.user}-oftree-${global.hostname}" +nfsroot="/home/${global.user}/nfsroot/${global.hostname}" +bootargs-ip +global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp" diff --git a/arch/arm/boards/highbank/env/config b/arch/arm/boards/highbank/env/config deleted file mode 100644 index 1bb2c493b..000000000 --- a/arch/arm/boards/highbank/env/config +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -# use 'dhcp' to do dhcp in barebox and in kernel -# use 'none' if you want to skip kernel ip autoconfiguration -ip=dhcp -global.dhcp.vendor_id=barebox-highbank - -# 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 'nor' -kernel_loc=tftp -# can be either 'net', 'nor' or 'initrd' -rootfs_loc=initrd - -# can be either 'jffs2' or 'ubifs' -rootfs_type=ubifs -rootfsimage=root.$rootfs_type - -kernelimage=zImage -#kernelimage=uImage -#kernelimage=Image -#kernelimage=Image.lzo - -autoboot_timeout=3 - -bootargs="console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0" - -# set a fancy prompt (if support is compiled in) -PS1="\e[1;31m[barebox@\h]:\w\e[0m\n# " diff --git a/arch/arm/boards/highbank/env/config-board b/arch/arm/boards/highbank/env/config-board new file mode 100644 index 000000000..a64d9e324 --- /dev/null +++ b/arch/arm/boards/highbank/env/config-board @@ -0,0 +1,11 @@ +#!/bin/sh + +# board defaults, do not change in running system. Change /env/config +# instead + +global.hostname=highbank +global.allow_color=true +global.autoboot_timeout=3 +global.bootm.oftree="/dev/dtb" +global.linux.bootargs.base="console=ttyAMA0,115200n8 CONSOLE=/dev/ttyAMA0" +global.boot.default=/env/boot.d diff --git a/arch/arm/boards/highbank/env/data/oftree b/arch/arm/boards/highbank/env/data/oftree new file mode 100644 index 000000000..9a94b310c --- /dev/null +++ b/arch/arm/boards/highbank/env/data/oftree @@ -0,0 +1,4 @@ +#!/bin/sh + +#device tree provided by the firmware +global.bootm.oftree="/dev/dtb" diff --git a/arch/arm/boards/highbank/env/bin/init_board b/arch/arm/boards/highbank/env/init/001-dtb-probe similarity index 100% rename from arch/arm/boards/highbank/env/bin/init_board rename to arch/arm/boards/highbank/env/init/001-dtb-probe diff --git a/arch/arm/boards/highbank/env/init/automount b/arch/arm/boards/highbank/env/init/automount new file mode 100644 index 000000000..2c283c6ee --- /dev/null +++ b/arch/arm/boards/highbank/env/init/automount @@ -0,0 +1,27 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "Automountpoints" + exit +fi + +# automount tftp server based on $eth0.serverip + +mkdir -p /mnt/tftp +automount /mnt/tftp 'ifup eth0 && mount -t tftp $eth0.serverip /mnt/tftp' + +# SD card slot, boot partition +mkdir -p /mnt/mmc-boot +automount -d /mnt/mmc 'mount /dev/disk0.boot /mnt/mmc-boot' + +# SD card slot, first partition +mkdir -p /mnt/mmc +automount -d /mnt/mmc 'mount /dev/disk0.0 /mnt/mmc' + +# AHCI, boot partition +mkdir -p /mnt/ahci-boot +automount -d /mnt/ahci 'mount /dev/ata0.boot /mnt/ahci-boot' + +# AHCI, first partition +mkdir -p /mnt/ahci +automount -d /mnt/ahci 'mount /dev/ata0.0 /mnt/ahci' diff --git a/arch/arm/boards/highbank/env/init/ps1 b/arch/arm/boards/highbank/env/init/ps1 new file mode 100644 index 000000000..a94acc14f --- /dev/null +++ b/arch/arm/boards/highbank/env/init/ps1 @@ -0,0 +1,9 @@ +#!/bin/sh + +/env/config + +if [ ${global.allow_color} = "true" ]; then + export PS1="\e[1;32mbarebox@\e[1;36m\h:\w\e[0m\n# " +else + export PS1="barebox@\h:\w\n# " +fi diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig index 47c6405eb..9cfe53968 100644 --- a/arch/arm/mach-highbank/Kconfig +++ b/arch/arm/mach-highbank/Kconfig @@ -12,6 +12,7 @@ choice config MACH_HIGHBANK bool "Calxeda Highbank" + select HAVE_DEFAULT_ENVIRONMENT_NEW endchoice From b6404068f12b7745170760f87bc96cc14add902b Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Mon, 15 Apr 2013 18:19:45 +0200 Subject: [PATCH 03/20] commands: the crc command is actually called crc32 Signed-off-by: Jan Luebbe Signed-off-by: Sascha Hauer --- commands/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/Kconfig b/commands/Kconfig index 00627580e..aa51b85e2 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -308,12 +308,12 @@ config CMD_MEMORY config CMD_CRC tristate select CRC32 - prompt "crc" + prompt "crc32" config CMD_CRC_CMP tristate depends on CMD_CRC - prompt "compare 2 files crc" + prompt "compare 2 files using crc32" config CMD_DIGEST tristate From 7691202bdd2736fcd4162c3464210bb5fab92f8b Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Tue, 16 Apr 2013 21:36:09 +0400 Subject: [PATCH 04/20] Remove unimplemented usb_driver_unregister declaration We do not have usb_driver_unregister function, so remove this declaration. Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- include/usb/usb.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/usb/usb.h b/include/usb/usb.h index afccf706d..b2700127f 100644 --- a/include/usb/usb.h +++ b/include/usb/usb.h @@ -196,7 +196,6 @@ struct usb_driver { extern struct bus_type usb_bus_type; int usb_driver_register(struct usb_driver *); -int usb_driver_unregister(struct usb_driver *); struct usb_host { int (*init)(struct usb_host *); From 4d43f79dd5d884cf3b89ac33b790454bbc97db9a Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 17 Apr 2013 11:42:01 +0200 Subject: [PATCH 05/20] defaultenv-2: net: use oftree when existing For booting with devicetree we had to adjust /env/boot/net manually. Instead, test if a devicetree exists and if yes, use it. This makes for a better default. Signed-off-by: Sascha Hauer --- defaultenv-2/base/boot/net | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/defaultenv-2/base/boot/net b/defaultenv-2/base/boot/net index 90c25aa14..05bb728fa 100644 --- a/defaultenv-2/base/boot/net +++ b/defaultenv-2/base/boot/net @@ -8,7 +8,12 @@ fi path="/mnt/tftp" global.bootm.image="${path}/${global.user}-linux-${global.hostname}" -#global.bootm.oftree="${path}/${global.user}-oftree-${global.hostname}" + +oftree="${path}/${global.user}-oftree-${global.hostname}" +if [ -f "${oftree}" ]; then + global.bootm.oftree="$oftree" +fi + nfsroot="/home/${global.user}/nfsroot/${global.hostname}" bootargs-ip global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp" From 07c62e1060ea411afa48cfc38bb9c9d48a17ce9b Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Thu, 18 Apr 2013 12:25:33 +0200 Subject: [PATCH 06/20] Makefile: drop duplicate definition of cmd_objcopy This command is already defined in scripts/Makefile.lib, which is included from Makefile. Signed-off-by: Jan Luebbe Signed-off-by: Sascha Hauer --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index a7db9de08..f0fd70afc 100644 --- a/Makefile +++ b/Makefile @@ -667,9 +667,6 @@ define rule_barebox-modpost $(Q)echo 'cmd_$@ := $(cmd_barebox-modpost)' > $(dot-target).cmd endef -quiet_cmd_objcopy = OBJCOPY $@ - cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ - OBJCOPYFLAGS_barebox.bin = -O binary barebox.bin: barebox FORCE From a9634ce95b92b052a00912f4d2e5330f04997784 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Wed, 17 Apr 2013 19:14:12 +0200 Subject: [PATCH 07/20] defaultenv-2: init: display prompt after running /env/init/* This allows init scripts to print messages to the console without messing up the timeout prompt. Signed-off-by: Jan Luebbe Signed-off-by: Sascha Hauer --- defaultenv-2/base/bin/init | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/defaultenv-2/base/bin/init b/defaultenv-2/base/bin/init index 6a658d137..ca02ba642 100644 --- a/defaultenv-2/base/bin/init +++ b/defaultenv-2/base/bin/init @@ -16,12 +16,6 @@ global editcmd=sedit [ -e /env/config-board ] && /env/config-board /env/config -if [ -e /env/menu ]; then - echo -e -n "\nHit m for menu or any other key to stop autoboot: " -else - echo -e -n "\nHit any key to stop autoboot: " -fi - # allow to stop the boot before execute the /env/init/* # but without waiting timeout -s -a -v key 0 @@ -34,6 +28,12 @@ for i in /env/init/*; do . $i done +if [ -e /env/menu ]; then + echo -e -n "\nHit m for menu or any other key to stop autoboot: " +else + echo -e -n "\nHit any key to stop autoboot: " +fi + timeout -a $global.autoboot_timeout -v key autoboot="$?" From 82095bff69e509bbae08ab0c9596e5c4ff5b5a77 Mon Sep 17 00:00:00 2001 From: Jan Weitzel Date: Fri, 26 Apr 2013 15:52:18 +0200 Subject: [PATCH 08/20] ARM: mmu: Use PAGE_ALIGN in dma_free_coherent We PAGE_ALIGN the size in dma_alloc_coherent so do it also when free the memory. Use PAGE_SIZE instead of magic numbers. Signed-off-by: Jan Weitzel Signed-off-by: Sascha Hauer --- arch/arm/cpu/mmu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c index 34fe5c351..e3ea3b6b9 100644 --- a/arch/arm/cpu/mmu.c +++ b/arch/arm/cpu/mmu.c @@ -189,7 +189,7 @@ static int arm_mmu_remap_sdram(struct memory_bank *bank) ptes, ttb_start, ttb_end); for (i = 0; i < num_ptes; i++) { - ptes[i] = (phys + i * 4096) | PTE_TYPE_SMALL | + ptes[i] = (phys + i * PAGE_SIZE) | PTE_TYPE_SMALL | pte_flags_cached; } @@ -300,7 +300,7 @@ static int mmu_init(void) asm volatile ("mcr p15,0,%0,c3,c0,0" : : "r"(i) /*:*/); /* create a flat mapping using 1MiB sections */ - create_sections(0, 0, 4096, PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | + create_sections(0, 0, PAGE_SIZE, PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT); vectors_init(); @@ -332,7 +332,7 @@ void *dma_alloc_coherent(size_t size) void *ret; size = PAGE_ALIGN(size); - ret = xmemalign(4096, size); + ret = xmemalign(PAGE_SIZE, size); dma_inv_range((unsigned long)ret, (unsigned long)ret + size); @@ -353,6 +353,7 @@ void *phys_to_virt(unsigned long phys) void dma_free_coherent(void *mem, size_t size) { + size = PAGE_ALIGN(size); remap_range(mem, size, pte_flags_cached); free(mem); From 91214e3abf2d9c753b18f29511e1f428ccfb5f5a Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Sun, 28 Apr 2013 08:27:26 +0400 Subject: [PATCH 09/20] ata: Remove wrong DISK_DRIVE symbol DISK_DRIVE is missing in Kconfig, so remove the "select" statement. Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- drivers/ata/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 42f2065a6..9830cc07a 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig @@ -35,7 +35,6 @@ config DISK_ATA config DISK_AHCI bool "AHCI support" select DISK_ATA - select DISK_DRIVE config DISK_AHCI_IMX depends on ARCH_IMX From c64c3c0d995e301ed70e680ed74b8bedf3b13ec1 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Sun, 28 Apr 2013 08:27:27 +0400 Subject: [PATCH 10/20] ARM: omap: Remove wrong OMAP_CLOCK_ALL symbol OMAP_CLOCK_ALL is missing in Kconfig, so remove the "select" statement and all other references to this symbol. Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- arch/arm/configs/phycard_a_l1_defconfig | 1 - arch/arm/mach-omap/Kconfig | 2 -- arch/arm/mach-omap/omap3_clock.c | 6 ------ 3 files changed, 9 deletions(-) diff --git a/arch/arm/configs/phycard_a_l1_defconfig b/arch/arm/configs/phycard_a_l1_defconfig index d90a333e0..fabaa2d68 100644 --- a/arch/arm/configs/phycard_a_l1_defconfig +++ b/arch/arm/configs/phycard_a_l1_defconfig @@ -7,7 +7,6 @@ CONFIG_CPU_V7=y CONFIG_CPU_32v7=y CONFIG_BOARDINFO="Phytec phyCARD-A-L1" CONFIG_ARCH_OMAP3=y -CONFIG_OMAP_CLOCK_ALL=y CONFIG_OMAP_CLOCK_SOURCE_S32K=y CONFIG_OMAP3_CLOCK_CONFIG=y CONFIG_OMAP3_COPY_CLOCK_SRAM=n diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig index 42e5f4af0..0913d0e13 100644 --- a/arch/arm/mach-omap/Kconfig +++ b/arch/arm/mach-omap/Kconfig @@ -134,7 +134,6 @@ config MACH_BEAGLE config MACH_BEAGLEBONE bool "Texas Instrument's Beagle Bone" - select OMAP_CLOCK_ALL depends on ARCH_AM33XX help Say Y here if you are using Beagle Bone @@ -179,7 +178,6 @@ config MACH_PCAAXL2 config MACH_PCM051 bool "Phytec phyCORE pcm051" - select OMAP_CLOCK_ALL select HAVE_DEFAULT_ENVIRONMENT_NEW depends on ARCH_AM33XX help diff --git a/arch/arm/mach-omap/omap3_clock.c b/arch/arm/mach-omap/omap3_clock.c index bcde48ff6..03aca492a 100644 --- a/arch/arm/mach-omap/omap3_clock.c +++ b/arch/arm/mach-omap/omap3_clock.c @@ -652,12 +652,6 @@ void prcm_init(void) /** * @brief Enable the clks & power for perifs * - * GPT2 Sysclk, ICLK,FCLK, 32k Sync is enabled by default - * Uses CONFIG_OMAP_CLOCK_UART to enable UART clocks - * Uses CONFIG_OMAP_CLOCK_I2C to enable I2C clocks - * Uses CONFIG_OMAP_CLOCK_ALL to enable All Clocks! - * - Not a wise idea in most cases - * * @return void */ static void per_clocks_enable(void) From 59dc8f1a39b6971ac9d03aa1086d06e33e06fdb1 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Sun, 28 Apr 2013 08:27:28 +0400 Subject: [PATCH 11/20] ARM: netx: Remove references for missing boards Barebox do not have support for MACH_NXDKN, MACH_NXHMIBB, MACH_NXEB500HMI and MACH_NXHX boards, so remove these symbols. Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- arch/arm/mach-netx/Kconfig | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/arch/arm/mach-netx/Kconfig b/arch/arm/mach-netx/Kconfig index 8d8f49b85..3c62d605a 100644 --- a/arch/arm/mach-netx/Kconfig +++ b/arch/arm/mach-netx/Kconfig @@ -9,35 +9,19 @@ config BOARDINFO config NETX_SDRAM_CTRL hex - default 0x010D0001 if MACH_NXDKN default 0x010D0121 if MACH_NXDB500 - default 0x030D0111 if MACH_NXHMIBB - default 0x010D0111 if MACH_NXEB500HMI - default 0x030D0001 if MACH_NXHX config NETX_SDRAM_TIMING_CTRL hex - default 0x03C12151 if MACH_NXDKN default 0x03C13261 if MACH_NXDB500 - default 0x03C13251 if MACH_NXHMIBB - default 0x03C13251 if MACH_NXEB500HMI - default 0x03C23251 if MACH_NXHX config NETX_MEM_CTRL hex - default 0x0103030F if MACH_NXDKN default 0x0203030F if MACH_NXDB500 - default 0x0103030F if MACH_NXHMIBB - default 0x0103030F if MACH_NXEB500HMI - default 0x0103030F if MACH_NXHX config NETX_COOKIE hex - default 16 if MACH_NXDKN default 32 if MACH_NXDB500 - default 16 if MACH_NXHMIBB - default 16 if MACH_NXEB500HMI - default 16 if MACH_NXHX choice prompt "Netx Board Type" From 7077230b4609c760d2b30851048dcaccacb3e9a6 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Sun, 28 Apr 2013 08:27:29 +0400 Subject: [PATCH 12/20] ARM: imx: Fix incorrect Kconfig symbols for some boards This patch fix incorrect Kconfig symbols for MACH_FREESCALE_MX51_PDK, MACH_FREESCALE_MX53_LOCO and MACH_FREESCALE_MX53_SMD. Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- arch/arm/mach-imx/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 8ddec9d60..eee6acd04 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig @@ -17,9 +17,9 @@ config ARCH_TEXT_BASE default 0x87f00000 if MACH_PCM043 default 0x08f80000 if MACH_SCB9328 default 0xa7e00000 if MACH_NESO - default 0x97f00000 if MACH_MX51_PDK - default 0x7ff00000 if MACH_MX53_LOCO - default 0x7ff00000 if MACH_MX53_SMD + default 0x97f00000 if MACH_FREESCALE_MX51_PDK + default 0x7ff00000 if MACH_FREESCALE_MX53_LOCO + default 0x7ff00000 if MACH_FREESCALE_MX53_SMD default 0x87f00000 if MACH_GUF_CUPID default 0x93d00000 if MACH_TX25 default 0x7ff00000 if MACH_TQMA53 From e1f458ac5376db84ac16e2fe397b91ae2397dedb Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Fri, 26 Apr 2013 20:41:07 +0400 Subject: [PATCH 13/20] ARM: at91 gpio: Fix possible null pointer dereference Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- arch/arm/mach-at91/gpio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index c2618c7b5..0e39a526d 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c @@ -185,10 +185,10 @@ static struct at91_pinctrl_mux_ops at91sam9x5_ops = { int at91_mux_pin(unsigned pin, enum at91_mux mux, int use_pullup) { struct at91_gpio_chip *at91_gpio = pin_to_controller(pin); - void __iomem *pio = at91_gpio->regbase; + void __iomem *pio; + struct device_d *dev; unsigned mask = pin_to_mask(pin); int bank = pin_to_bank(pin); - struct device_d *dev = at91_gpio->chip.dev; if (!at91_gpio) return -EINVAL; @@ -197,6 +197,7 @@ int at91_mux_pin(unsigned pin, enum at91_mux mux, int use_pullup) if (!pio) return -EINVAL; + dev = at91_gpio->chip.dev; at91_mux_disable_interrupt(pio, mask); pin %= MAX_NB_GPIO_PER_BANK; From 857eb73c9420fbfd597f5188ee2006bebabf5226 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Fri, 26 Apr 2013 20:41:08 +0400 Subject: [PATCH 14/20] ARM: at91 smc: Fix possible uninitialized variable Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- arch/arm/mach-at91/sam9_smc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c index b48275e07..a137da426 100644 --- a/arch/arm/mach-at91/sam9_smc.c +++ b/arch/arm/mach-at91/sam9_smc.c @@ -120,12 +120,12 @@ void sam9_smc_read(int id, int cs, struct sam9_smc_config *config) static int at91sam9_smc_probe(struct device_d *dev) { - int id; + int id = dev->id; - if (dev->id < 0) { + if (id < 0) { id = 0; - } else if (dev->id > 1) { - dev_warn(dev, ": id > 2\n"); + } else if (id > 1) { + dev_warn(dev, "id > 1\n"); return -EIO; } From ef3e752fa1992cf2fa4b947b240146ebcb712097 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Fri, 26 Apr 2013 20:41:09 +0400 Subject: [PATCH 15/20] MCI: atmel: Fix possible null pointer dereference Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- drivers/mci/atmel_mci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c index f03240310..c5fd306a9 100644 --- a/drivers/mci/atmel_mci.c +++ b/drivers/mci/atmel_mci.c @@ -262,11 +262,13 @@ static int atmci_read_response(struct atmel_mci *host, unsigned int stat) { struct mci_cmd *cmd = host->cmd; int i; - u32 *resp = (u32 *)cmd->response; + u32 *resp; if (!cmd) return 0; + resp = (u32 *)cmd->response; + if (stat & (ATMCI_RTOE | ATMCI_DTOE)) { dev_err(host->hw_dev, "command/data timeout\n"); return -ETIMEDOUT; From 32d531574fa46ecb4deee6d4e885e98f527827c4 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Fri, 26 Apr 2013 20:41:11 +0400 Subject: [PATCH 16/20] MCI: imx: Fix possible null pointer dereference Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- drivers/mci/imx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mci/imx.c b/drivers/mci/imx.c index 3d9bd0deb..c98596434 100644 --- a/drivers/mci/imx.c +++ b/drivers/mci/imx.c @@ -225,12 +225,13 @@ static int mxcmci_read_response(struct mxcmci_host *host, unsigned int stat) { struct mci_cmd *cmd = host->cmd; int i; - u32 a, b, c; - u32 *resp = (u32 *)cmd->response; + u32 a, b, c, *resp; if (!cmd) return 0; + resp = (u32 *)cmd->response; + if (stat & STATUS_TIME_OUT_RESP) { printf("CMD TIMEOUT\n"); return -ETIMEDOUT; From 7c15fd1b09349d853bf340fa58bcf71e85f716d2 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Fri, 26 Apr 2013 20:41:12 +0400 Subject: [PATCH 17/20] NAND: imx: Fix memory leak Signed-off-by: Alexander Shiyan Signed-off-by: Sascha Hauer --- drivers/mtd/nand/nand_imx_bbm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/nand_imx_bbm.c b/drivers/mtd/nand/nand_imx_bbm.c index 03961a0fb..135d74e66 100644 --- a/drivers/mtd/nand/nand_imx_bbm.c +++ b/drivers/mtd/nand/nand_imx_bbm.c @@ -91,7 +91,7 @@ static void *create_bbt(struct mtd_info *mtd) buf = malloc(mtd->writesize); if (!buf) { ret = -ENOMEM; - goto out; + goto out2; } numblocks = mtd->size >> (chip->bbt_erase_shift - 1); @@ -99,7 +99,7 @@ static void *create_bbt(struct mtd_info *mtd) for (i = 0; i < numblocks;) { ret = checkbad(mtd, from, buf); if (ret < 0) - goto out; + goto out1; if (ret) { bbt[i >> 3] |= 0x03 << (i & 0x6); @@ -112,8 +112,11 @@ static void *create_bbt(struct mtd_info *mtd) } return bbt; -out: + +out1: free(buf); +out2: + free(bbt); return ERR_PTR(ret); } From ce9163ae34cfec84206d3ae0bbd4b263323cc80c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Thu, 2 May 2013 11:07:11 +0200 Subject: [PATCH 18/20] bootm: Simplify initrd address handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit data.initrd_address = UIMAGE_SOME_ADDRESS; ... if (-L was given to bootm) data.initrd_address = address_provided_to_-L; ... if (initrd is provided as uInitrd && data.initrd_address == UIMAGE_SOME_ADDRESS) data.initrd_address = load_address_from_uInitrd; ... if (data.initrd_address == UIMAGE_SOME_ADDRESS) data.initrd_address = UIMAGE_INVALID_ADDRESS; can be simplified to: data.initrd_address = UIMAGE_INVALID_ADDRESS; ... if (-L was given to bootm) data.initrd_address = address_provided_to_-L; ... if (initrd is provided as uInitrd && data.initrd_address == UIMAGE_INVALID_ADDRESS) data.initrd_address = load_address_from_uInitrd; ... The only change introduced by this simplification is for cases where the user passes -L UIMAGE_SOME_ADDRESS or -L UIMAGE_INVALID_ADDRESS to bootm. (-L UIMAGE_SOME_ADDRESS is now used literally instead of ignored before. -L UIMAGE_INVALID_ADDRESS used to skip getting the initrd-address from the uInitrd, now the uInitrd address is honored.) Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- commands/bootm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commands/bootm.c b/commands/bootm.c index e5dfc6ab3..bb44776af 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -127,7 +127,7 @@ static int bootm_open_initrd_uimage(struct image_data *data) data->initrd = data->os; } - if (data->initrd_address == UIMAGE_SOME_ADDRESS) + if (data->initrd_address == UIMAGE_INVALID_ADDRESS) data->initrd_address = data->initrd->header.ih_load; return 0; @@ -256,7 +256,7 @@ static int do_bootm(int argc, char *argv[]) memset(&data, 0, sizeof(struct image_data)); - data.initrd_address = UIMAGE_SOME_ADDRESS; + data.initrd_address = UIMAGE_INVALID_ADDRESS; data.os_address = UIMAGE_SOME_ADDRESS; data.verify = 0; data.verbose = 0; @@ -408,8 +408,6 @@ static int do_bootm(int argc, char *argv[]) #endif if (data.os_address == UIMAGE_SOME_ADDRESS) data.os_address = UIMAGE_INVALID_ADDRESS; - if (data.initrd_address == UIMAGE_SOME_ADDRESS) - data.initrd_address = UIMAGE_INVALID_ADDRESS; handler = bootm_find_handler(os_type, &data); if (!handler) { From 88a012b9e14680149c0c970193e082fb5cf90157 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 2 May 2013 11:07:12 +0200 Subject: [PATCH 19/20] Don't honor initrd load address MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit U-Boot doesn't honor the load address specified in an initrd. Barebox shouldn't be more strict here. This unbreaks booting an uInitrd generated by Debian's flash-kernel that uses 0 as entry address where there is nothing on the i.MX53 that was used. Signed-off-by: Uwe Kleine-König Signed-off-by: Sascha Hauer --- commands/bootm.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/commands/bootm.c b/commands/bootm.c index bb44776af..5dd170353 100644 --- a/commands/bootm.c +++ b/commands/bootm.c @@ -127,9 +127,6 @@ static int bootm_open_initrd_uimage(struct image_data *data) data->initrd = data->os; } - if (data->initrd_address == UIMAGE_INVALID_ADDRESS) - data->initrd_address = data->initrd->header.ih_load; - return 0; } From 9e809ef4317cf96a477342a09b8c205a49e44554 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 3 May 2013 18:51:05 +0200 Subject: [PATCH 20/20] scripts: allow lines longer than 80 cols with printf() in checkpatch The checkpatch.pl script is also used to validate user-space code in the scripts/ directory, so it should allow printf() lines to be longer than 80 columns. Signed-off-by: Thomas Petazzoni Signed-off-by: Sascha Hauer --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0d94f982f..e80926fa0 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -209,7 +209,7 @@ our $typeTypedefs = qr{(?x: )}; our $logFunctions = qr{(?x: - printk| + printk|printf| pr_(debug|dbg|vdbg|devel|info|warning|err|notice|alert|crit|emerg|cont)| (dev|netdev|netif)_(printk|dbg|vdbg|info|warn|err|notice|alert|crit|emerg|WARN)| WARN|