9
0
Fork 0

Merge branch 'for-next/misc'

Conflicts:
	arch/arm/boards/chumby_falconwing/falconwing.c
	arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c
	arch/x86/mach-x86.dox
	scripts/setupmbr/setupmbr.c
This commit is contained in:
Sascha Hauer 2014-07-04 17:27:06 +02:00
commit efa4d684d8
61 changed files with 128 additions and 314 deletions

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "Android from SD card"
exit
fi
path=/mnt/sd path=/mnt/sd
global.bootm.image=${path}/android global.bootm.image=${path}/android
global.bootm.initrd=${path}/initramfs.cpio.lzo global.bootm.initrd=${path}/initramfs.cpio.lzo

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "Linux from SD card"
exit
fi
path=/mnt/sd path=/mnt/sd
global.bootm.image=${path}/zImage global.bootm.image=${path}/zImage
initrd=${path}/initrd initrd=${path}/initrd

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "Android over usb"
exit
fi
path=/mnt/usb path=/mnt/usb
global.bootm.image=${path}/android global.bootm.image=${path}/android
global.bootm.initrd=${path}/initramfs.cpio.lzo global.bootm.initrd=${path}/initramfs.cpio.lzo

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "Linux over usb"
exit
fi
path=/mnt/usb path=/mnt/usb
global.bootm.image=${path}/zImage global.bootm.image=${path}/zImage
initrd=${path}/initrd initrd=${path}/initrd

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "android (nand)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
global.linux.bootargs.dyn.root="root=/dev/mtdblock1 rootfstype=jffs2 rw init=/init rootdelay=1" global.linux.bootargs.dyn.root="root=/dev/mtdblock1 rootfstype=jffs2 rw init=/init rootdelay=1"
# clean the mtdparts otherwise android does not boot # clean the mtdparts otherwise android does not boot

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "MMC slot"
exit
fi
path="/mnt/mmc" path="/mnt/mmc"
global.bootm.image="${path}/zimage" global.bootm.image="${path}/zimage"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "network (tftp, nfs) (macb)"
exit
fi
ethact eth0 ethact eth0
path="/mnt/tftp" path="/mnt/tftp"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "network (tftp, nfs) (usb ethernet)"
exit
fi
usb -f usb -f
ethact eth1 ethact eth1

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "MMC (ext3)"
exit
fi
global.bootm.image="/boot/zImage" global.bootm.image="/boot/zImage"
#global.bootm.oftree="/boot/oftree" #global.bootm.oftree="/boot/oftree"
global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait" global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait"

View File

@ -1,9 +1,4 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs" global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
global.bootm.oftree="/dev/nand0.oftree.bb" global.bootm.oftree="/dev/nand0.oftree.bb"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs" global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "kernel & rootfs on SD card"
exit
fi
global.bootm.image=/boot/uImage global.bootm.image=/boot/uImage
global.bootm.oftree=/boot/oftree global.bootm.oftree=/boot/oftree
#global.bootm.initrd=<path to initrd> #global.bootm.initrd=<path to initrd>

View File

@ -1,19 +0,0 @@
#!/bin/sh
# change network settings in /env/network/eth0
# change mtd partition settings and automountpoints in /env/init/*
# set to false if you do not want to have colors
global.allow_color=true
# user (used for network filenames)
global.user=none
# timeout in seconds before the default boot entry is started
global.autoboot_timeout=3
# default boot entry (one of /env/boot/*)
global.boot.default=sd
# base bootargs
global.linux.bootargs.base="console=ttyO0,115200n8"

View File

@ -0,0 +1,5 @@
#!/bin/sh
echo -n "changing USB current limit to 1300 mA... "
i2c_write -b 0 -a 0x24 -r 0x01 0x3e
echo "done"

View File

@ -1,9 +1,4 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "NAND Flash"
exit
fi
global.bootm.image="/dev/kernel" global.bootm.image="/dev/kernel"
global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro" global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"

View File

@ -1,9 +1,4 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "NOR Flash"
exit
fi
global.bootm.image="/dev/kernel" global.bootm.image="/dev/kernel"
global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro" global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "MMC (ext)"
exit
fi
global.bootm.image="/mnt/disk0.2/boot/zImage-${global.hostname}" global.bootm.image="/mnt/disk0.2/boot/zImage-${global.hostname}"
global.bootm.oftree="/mnt/disk0.2/boot/oftree-${global.board.variant}" global.bootm.oftree="/mnt/disk0.2/boot/oftree-${global.board.variant}"
global.linux.bootargs.dyn.root="root=/dev/mmcblk0p3 rootfstype=ext3 rootwait" global.linux.bootargs.dyn.root="root=/dev/mmcblk0p3 rootfstype=ext3 rootwait"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "MMC"
exit
fi
global.bootm.image="/mnt/mmc/zImage" global.bootm.image="/mnt/mmc/zImage"
global.bootm.oftree="/mnt/mmc/oftree" global.bootm.oftree="/mnt/mmc/oftree"
global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait" global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "MMC"
exit
fi
global.bootm.image="/mnt/mmc/zImage" global.bootm.image="/mnt/mmc/zImage"
global.bootm.oftree="/mnt/mmc/oftree" global.bootm.oftree="/mnt/mmc/oftree"
global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait" global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "internal harddisk"
exit
fi
path="/mnt/internal-hd0.0" path="/mnt/internal-hd0.0"
global.bootm.image="${path}/linuximage" global.bootm.image="${path}/linuximage"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "left MMC slot"
exit
fi
path="/mnt/mmc-left.0" path="/mnt/mmc-left.0"
global.bootm.image="${path}/linuximage" global.bootm.image="${path}/linuximage"

View File

@ -70,7 +70,7 @@ mem_initcall(mx23_evk_mem_init);
* If this SD card is also the boot media, we can use the second partition * If this SD card is also the boot media, we can use the second partition
* for our environment purpose (if present!). * for our environment purpose (if present!).
*/ */
static int register_persistant_environment(void) static int register_persistent_environment(void)
{ {
struct cdev *cdev; struct cdev *cdev;
@ -116,9 +116,9 @@ static int mx23_evk_devices_init(void)
add_generic_device("mxs_mci", DEVICE_ID_DYNAMIC, NULL, IMX_SSP1_BASE, add_generic_device("mxs_mci", DEVICE_ID_DYNAMIC, NULL, IMX_SSP1_BASE,
0x8000, IORESOURCE_MEM, &mci_pdata); 0x8000, IORESOURCE_MEM, &mci_pdata);
rc = register_persistant_environment(); rc = register_persistent_environment();
if (rc != 0) if (rc != 0)
printf("Cannot create the 'env0' persistant " printf("Cannot create the 'env0' persistent "
"environment storage (%d)\n", rc); "environment storage (%d)\n", rc);
#ifdef CONFIG_USB_GADGET_DRIVER_ARC #ifdef CONFIG_USB_GADGET_DRIVER_ARC

View File

@ -1,9 +1,4 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs" global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree" #global.bootm.oftree="/env/oftree"
bootargs-root-ubi -r root -m nand0.root bootargs-root-ubi -r root -m nand0.root

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "AHCI"
exit
fi
path="/mnt/ahci" path="/mnt/ahci"
global.bootm.image="${path}/zImage" global.bootm.image="${path}/zImage"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "AHCI (UEFI boot partiton)"
exit
fi
path="/mnt/ahci-boot" path="/mnt/ahci-boot"
global.bootm.image="${path}/zImage" global.bootm.image="${path}/zImage"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "MMC slot"
exit
fi
path="/mnt/mmc" path="/mnt/mmc"
global.bootm.image="${path}/zimage" global.bootm.image="${path}/zimage"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "MMC slot (UEFI boot partiton)"
exit
fi
path="/mnt/mmc-boot" path="/mnt/mmc-boot"
global.bootm.image="${path}/zimage" global.bootm.image="${path}/zimage"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "network (tftp, nfs) (eth0)"
exit
fi
ethact eth0 ethact eth0
path="/mnt/tftp" path="/mnt/tftp"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "network (tftp, nfs) (eth1)"
exit
fi
ethact eth1 ethact eth1
path="/mnt/tftp" path="/mnt/tftp"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree" #global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs" global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"

View File

@ -1,9 +1,4 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "NOR Flash"
exit
fi
global.bootm.image="/dev/nor0.kernel" global.bootm.image="/dev/nor0.kernel"
global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro" global.linux.bootargs.dyn.root="root=/dev/mtdblock3 ro"

View File

@ -1,8 +1,3 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "SD Boot"
exit
fi
boot mci0 boot mci0

View File

@ -1,8 +1,3 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "USB Boot"
exit
fi
boot ehci0 boot ehci0

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "MMC (ext3)"
exit
fi
global.bootm.image="/boot/zImage" global.bootm.image="/boot/zImage"
#global.bootm.oftree="/boot/oftree" #global.bootm.oftree="/boot/oftree"
global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait" global.linux.bootargs.dyn.root="root=mmcblk0p2 rootfstype=ext3 rootwait"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "Kernel:nand;rootfs:nand"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree" #global.bootm.oftree="/env/oftree"
bootargs-ip bootargs-ip

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "MMC (ext3)"
exit
fi
global.bootm.image="/mnt/kernel/linuximage" global.bootm.image="/mnt/kernel/linuximage"
#global.bootm.oftree="/boot/oftree" #global.bootm.oftree="/boot/oftree"
bootargs-ip bootargs-ip

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "kernel & rootfs on SD card"
exit
fi
global.bootm.image=/boot/uImage global.bootm.image=/boot/uImage
#global.bootm.oftree=/boot/oftree #global.bootm.oftree=/boot/oftree
global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rootwait" global.linux.bootargs.dyn.root="root=/dev/mmcblk0p2 rootfstype=ext3 rootwait"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree" #global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root,2048 rootfstype=ubifs" global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root,2048 rootfstype=ubifs"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "SPI NOR Flash"
exit
fi
global.bootm.image="/dev/m25p0.kernel" global.bootm.image="/dev/m25p0.kernel"
# Use rootfs form NAND for now as rootfs partition < 4MB # Use rootfs form NAND for now as rootfs partition < 4MB

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree" #global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs" global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree" #global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs" global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree" #global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs" global.linux.bootargs.dyn.root="root=ubi0:root ubi.mtd=nand0.root rootfstype=ubifs"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "nand (UBI)"
exit
fi
global.bootm.image="/dev/nand0.kernel.bb" global.bootm.image="/dev/nand0.kernel.bb"
#global.bootm.oftree="/env/oftree" #global.bootm.oftree="/env/oftree"
global.linux.bootargs.dyn.root="root=ubi0:rootfs ubi.mtd=nand0.rootfs rootfstype=ubifs" global.linux.bootargs.dyn.root="root=ubi0:rootfs ubi.mtd=nand0.rootfs rootfstype=ubifs"

View File

@ -82,11 +82,11 @@ ALL PARAMETERS ARE ALL LONGWORDS (FOUR BYTES EACH).
sdma->IntPend = (1 << tasknum); \ sdma->IntPend = (1 << tasknum); \
} }
/* get interupt pending bit of a task */ /* get interrupt pending bit of a task */
#define SDMA_GET_PENDINGBIT(tasknum) \ #define SDMA_GET_PENDINGBIT(tasknum) \
((*(vu_long *)(MPC5XXX_SDMA + 0x14)) & (1<<(tasknum))) ((*(vu_long *)(MPC5XXX_SDMA + 0x14)) & (1<<(tasknum)))
/* get interupt mask bit of a task */ /* get interrupt mask bit of a task */
#define SDMA_GET_MASKBIT(tasknum) \ #define SDMA_GET_MASKBIT(tasknum) \
((*(vu_long *)(MPC5XXX_SDMA + 0x18)) & (1<<(tasknum))) ((*(vu_long *)(MPC5XXX_SDMA + 0x18)) & (1<<(tasknum)))

View File

@ -12,4 +12,11 @@
#include <asm-generic/bitops/hweight.h> #include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/ops.h> #include <asm-generic/bitops/ops.h>
#define set_bit(x, y) __set_bit(x, y)
#define clear_bit(x, y) __clear_bit(x, y)
#define change_bit(x, y) __change_bit(x, y)
#define test_and_set_bit(x, y) __test_and_set_bit(x, y)
#define test_and_clear_bit(x, y) __test_and_clear_bit(x, y)
#define test_and_change_bit(x, y) __test_and_change_bit(x, y)
#endif #endif

View File

@ -85,7 +85,7 @@ SECTIONS
boot_disk = .; boot_disk = .;
BYTE(0x00); /* boot disk number (provided by the BIOS) BYTE(0x00); /* boot disk number (provided by the BIOS)
/* information about the persistant environment storage */ /* information about the persistent environment storage */
. = PATCH_AREA + PATCH_AREA_PERS_START; . = PATCH_AREA + PATCH_AREA_PERS_START;
pers_env_storage = .; pers_env_storage = .;
LONG(0x00000000); /* LBA start lower */ LONG(0x00000000); /* LBA start lower */

View File

@ -31,27 +31,27 @@
#define PATCH_AREA_BOOT_DEV 16 #define PATCH_AREA_BOOT_DEV 16
/** /**
* Offset where to store information about the persistant environment storage * Offset where to store information about the persistent environment storage
* It points to an LBA number (8 bytes) and defines the first sector of this * It points to an LBA number (8 bytes) and defines the first sector of this
* storage on disk. * storage on disk.
*/ */
#define PATCH_AREA_PERS_START 20 #define PATCH_AREA_PERS_START 20
/** /**
* Offset where to store information about the persistant environment storage * Offset where to store information about the persistent environment storage
* It points to a short number (2 bytes) and defines the sector count of this * It points to a short number (2 bytes) and defines the sector count of this
* storage on disk. * storage on disk.
*/ */
#define PATCH_AREA_PERS_SIZE 28 #define PATCH_AREA_PERS_SIZE 28
/** /**
* Offset where to store information about the persistant environment storage * Offset where to store information about the persistent environment storage
* drive number (BIOS number, 1 byte) * drive number (BIOS number, 1 byte)
*/ */
#define PATCH_AREA_PERS_DRIVE 30 #define PATCH_AREA_PERS_DRIVE 30
/** /**
* Mark the persistant environment as not used * Mark the persistent environment as not used
*/ */
#define PATCH_AREA_PERS_SIZE_UNUSED 0x000 #define PATCH_AREA_PERS_SIZE_UNUSED 0x000

View File

@ -151,7 +151,7 @@ static int bootscript_scan_path(struct blspec *blspec, const char *path)
glob(files, 0, NULL, &globb); glob(files, 0, NULL, &globb);
for (i = 0; i < globb.gl_pathc; i++) { for (i = 0; i < globb.gl_pathc; i++) {
char *bootscript_path = globb.gl_pathv[i];; char *bootscript_path = globb.gl_pathv[i];
if (*basename(bootscript_path) == '.') if (*basename(bootscript_path) == '.')
continue; continue;

View File

@ -53,6 +53,8 @@ int ls(const char *path, ulong flags)
char tmp[PATH_MAX]; char tmp[PATH_MAX];
struct stat s; struct stat s;
struct string_list sl; struct string_list sl;
struct string_list *entry;
int ret;
string_list_init(&sl); string_list_init(&sl);
@ -71,51 +73,51 @@ int ls(const char *path, ulong flags)
if (!dir) if (!dir)
return -errno; return -errno;
while ((d = readdir(dir))) { while ((d = readdir(dir)))
sprintf(tmp, "%s/%s", path, d->d_name); string_list_add_sorted(&sl, d->d_name);
if (flags & LS_COLUMN) {
string_list_add_sorted(&sl, d->d_name);
} else {
if (lstat(tmp, &s))
goto out;
ls_one(d->d_name, tmp, &s);
}
}
closedir(dir); closedir(dir);
if (flags & LS_COLUMN) { if (flags & LS_COLUMN) {
string_list_print_by_column(&sl); string_list_print_by_column(&sl);
string_list_free(&sl); } else {
string_list_for_each_entry(entry, &sl) {
sprintf(tmp, "%s/%s", path, entry->str);
ret = lstat(tmp, &s);
if (ret) {
printf("%s: %s\n", tmp, strerror(-ret));
continue;
}
ls_one(entry->str, tmp, &s);
}
} }
if (!(flags & LS_RECURSIVE)) if (!(flags & LS_RECURSIVE))
return 0; goto out;
dir = opendir(path); string_list_for_each_entry(entry, &sl) {
if (!dir) { if (!strcmp(entry->str, "."))
errno = ENOENT;
return -ENOENT;
}
while ((d = readdir(dir))) {
if (!strcmp(d->d_name, "."))
continue; continue;
if (!strcmp(d->d_name, "..")) if (!strcmp(entry->str, ".."))
continue; continue;
sprintf(tmp, "%s/%s", path, d->d_name); sprintf(tmp, "%s/%s", path, entry->str);
ret = lstat(tmp, &s);
if (ret) {
printf("%s: %s\n", tmp, strerror(-ret));
continue;
}
if (lstat(tmp, &s))
goto out;
if (s.st_mode & S_IFDIR) { if (s.st_mode & S_IFDIR) {
char *norm = normalise_path(tmp); char *norm = normalise_path(tmp);
ls(norm, flags); ls(norm, flags);
free(norm); free(norm);
} }
} }
out: out:
closedir(dir); string_list_free(&sl);
return 0; return 0;
} }
@ -127,6 +129,9 @@ static int do_ls(int argc, char *argv[])
ulong flags = LS_COLUMN; ulong flags = LS_COLUMN;
struct string_list sl; struct string_list sl;
if (!strcmp(argv[0], "ll"))
flags &= ~LS_COLUMN;
while((opt = getopt(argc, argv, "RCl")) > 0) { while((opt = getopt(argc, argv, "RCl")) > 0) {
switch(opt) { switch(opt) {
case 'R': case 'R':
@ -219,3 +224,11 @@ BAREBOX_CMD_START(ls)
BAREBOX_CMD_GROUP(CMD_GRP_FILE) BAREBOX_CMD_GROUP(CMD_GRP_FILE)
BAREBOX_CMD_HELP(cmd_ls_help) BAREBOX_CMD_HELP(cmd_ls_help)
BAREBOX_CMD_END BAREBOX_CMD_END
BAREBOX_CMD_START(ll)
.cmd = do_ls,
BAREBOX_CMD_DESC("list a file or directory with details")
BAREBOX_CMD_OPTS("[-lCR] [FILEDIR...]")
BAREBOX_CMD_GROUP(CMD_GRP_FILE)
BAREBOX_CMD_HELP(cmd_ls_help)
BAREBOX_CMD_END

View File

@ -115,14 +115,14 @@ static int show_basic_mii(struct mii_bus *mii, struct phy_device *phydev,
for (i = 0; i < 32; i++) for (i = 0; i < 32; i++)
mii_val[i] = mii->read(mii, phydev->addr, i); mii_val[i] = mii->read(mii, phydev->addr, i);
printf("%s: %s%d: ", phydev->cdev.name,
mii->parent->name, mii->parent->id);
if (mii_val[MII_BMCR] == 0xffff || mii_val[MII_BMSR] == 0x0000) { if (mii_val[MII_BMCR] == 0xffff || mii_val[MII_BMSR] == 0x0000) {
fprintf(stderr, " No MII transceiver present!.\n"); fprintf(stderr, " No MII transceiver present!.\n");
return -1; return -1;
} }
printf("%s: %s%d: ", phydev->cdev.name,
mii->parent->name, mii->parent->id);
/* Descriptive rename. */ /* Descriptive rename. */
bmcr = mii_val[MII_BMCR]; bmcr = mii_val[MII_BMCR];
bmsr = mii_val[MII_BMSR]; bmsr = mii_val[MII_BMSR];

View File

@ -71,7 +71,7 @@ struct resource *__request_region(struct resource *parent,
goto ok; goto ok;
if (start > r->end) if (start > r->end)
continue; continue;
debug("%s: 0x%08llx:0x%08llx conflicts with 0x%08llx:0x%08llx\n", pr_warn("%s: 0x%08llx:0x%08llx conflicts with 0x%08llx:0x%08llx\n",
__func__, __func__,
(unsigned long long)start, (unsigned long long)start,
(unsigned long long)end, (unsigned long long)end,

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "network (tftp, nfs)"
exit
fi
path="/mnt/tftp" path="/mnt/tftp"
global.bootm.image="${path}/${global.user}-linux-${global.hostname}" global.bootm.image="${path}/${global.user}-linux-${global.hostname}"

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "<menu text here>"
exit
fi
global.bootm.image=<path to image> global.bootm.image=<path to image>
#global.bootm.oftree=<path to oftree> #global.bootm.oftree=<path to oftree>
#global.bootm.initrd=<path to initrd> #global.bootm.initrd=<path to initrd>

View File

@ -1,10 +1,5 @@
#!/bin/sh #!/bin/sh
if [ "$1" = menu ]; then
boot-menu-add-entry "$0" "Device Firmware upgrade (DFU)"
exit
fi
if [ -d /dfutmp ]; then if [ -d /dfutmp ]; then
rm -r /dfutmp rm -r /dfutmp
fi fi

View File

@ -29,4 +29,7 @@ static inline void string_list_free(struct string_list *sl)
} }
} }
#define string_list_for_each_entry(entry, sl) \
list_for_each_entry(entry, &(sl)->list, list)
#endif /* __STRINGLIST_H */ #endif /* __STRINGLIST_H */

View File

@ -73,6 +73,8 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
len = *ip++; len = *ip++;
for (; len == 255; length += 255) for (; len == 255; length += 255)
len = *ip++; len = *ip++;
if (unlikely(length > (size_t)(length + len)))
goto _output_error;
length += len; length += len;
} }
@ -107,6 +109,8 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
if (length == ML_MASK) { if (length == ML_MASK) {
for (; *ip == 255; length += 255) for (; *ip == 255; length += 255)
ip++; ip++;
if (unlikely(length > (size_t)(length + *ip)))
goto _output_error;
length += *ip++; length += *ip++;
} }
@ -156,7 +160,7 @@ static int lz4_uncompress(const char *source, char *dest, int osize)
/* write overflow error detected */ /* write overflow error detected */
_output_error: _output_error:
return (int) (-(((char *)ip) - source)); return -1;
} }
static int lz4_uncompress_unknownoutputsize(const char *source, char *dest, static int lz4_uncompress_unknownoutputsize(const char *source, char *dest,

View File

@ -16,14 +16,34 @@
#include <lzo.h> #include <lzo.h>
#include "lzodefs.h" #include "lzodefs.h"
#define HAVE_IP(x) ((size_t)(ip_end - ip) >= (size_t)(x)) #define HAVE_IP(t, x) \
#define HAVE_OP(x) ((size_t)(op_end - op) >= (size_t)(x)) (((size_t)(ip_end - ip) >= (size_t)(t + x)) && \
#define NEED_IP(x) if (!HAVE_IP(x)) goto input_overrun (((t + x) >= t) && ((t + x) >= x)))
#define NEED_OP(x) if (!HAVE_OP(x)) goto output_overrun
#define TEST_LB(m_pos) if ((m_pos) < out) goto lookbehind_overrun #define HAVE_OP(t, x) \
(((size_t)(op_end - op) >= (size_t)(t + x)) && \
(((t + x) >= t) && ((t + x) >= x)))
#define NEED_IP(t, x) \
do { \
if (!HAVE_IP(t, x)) \
goto input_overrun; \
} while (0)
#define NEED_OP(t, x) \
do { \
if (!HAVE_OP(t, x)) \
goto output_overrun; \
} while (0)
#define TEST_LB(m_pos) \
do { \
if ((m_pos) < out) \
goto lookbehind_overrun; \
} while (0)
int lzo1x_decompress_safe(const unsigned char *in, size_t in_len, int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
unsigned char *out, size_t *out_len) unsigned char *out, size_t *out_len)
{ {
unsigned char *op; unsigned char *op;
const unsigned char *ip; const unsigned char *ip;
@ -55,14 +75,14 @@ int lzo1x_decompress_safe(const unsigned char *in, size_t in_len,
while (unlikely(*ip == 0)) { while (unlikely(*ip == 0)) {
t += 255; t += 255;
ip++; ip++;
NEED_IP(1); NEED_IP(1, 0);
} }
t += 15 + *ip++; t += 15 + *ip++;
} }
t += 3; t += 3;
copy_literal_run: copy_literal_run:
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
if (likely(HAVE_IP(t + 15) && HAVE_OP(t + 15))) { if (likely(HAVE_IP(t, 15) && HAVE_OP(t, 15))) {
const unsigned char *ie = ip + t; const unsigned char *ie = ip + t;
unsigned char *oe = op + t; unsigned char *oe = op + t;
do { do {
@ -78,8 +98,8 @@ copy_literal_run:
} else } else
#endif #endif
{ {
NEED_OP(t); NEED_OP(t, 0);
NEED_IP(t + 3); NEED_IP(t, 3);
do { do {
*op++ = *ip++; *op++ = *ip++;
} while (--t > 0); } while (--t > 0);
@ -92,7 +112,7 @@ copy_literal_run:
m_pos -= t >> 2; m_pos -= t >> 2;
m_pos -= *ip++ << 2; m_pos -= *ip++ << 2;
TEST_LB(m_pos); TEST_LB(m_pos);
NEED_OP(2); NEED_OP(2, 0);
op[0] = m_pos[0]; op[0] = m_pos[0];
op[1] = m_pos[1]; op[1] = m_pos[1];
op += 2; op += 2;
@ -116,10 +136,10 @@ copy_literal_run:
while (unlikely(*ip == 0)) { while (unlikely(*ip == 0)) {
t += 255; t += 255;
ip++; ip++;
NEED_IP(1); NEED_IP(1, 0);
} }
t += 31 + *ip++; t += 31 + *ip++;
NEED_IP(2); NEED_IP(2, 0);
} }
m_pos = op - 1; m_pos = op - 1;
next = get_unaligned_le16(ip); next = get_unaligned_le16(ip);
@ -134,10 +154,10 @@ copy_literal_run:
while (unlikely(*ip == 0)) { while (unlikely(*ip == 0)) {
t += 255; t += 255;
ip++; ip++;
NEED_IP(1); NEED_IP(1, 0);
} }
t += 7 + *ip++; t += 7 + *ip++;
NEED_IP(2); NEED_IP(2, 0);
} }
next = get_unaligned_le16(ip); next = get_unaligned_le16(ip);
ip += 2; ip += 2;
@ -151,7 +171,7 @@ copy_literal_run:
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
if (op - m_pos >= 8) { if (op - m_pos >= 8) {
unsigned char *oe = op + t; unsigned char *oe = op + t;
if (likely(HAVE_OP(t + 15))) { if (likely(HAVE_OP(t, 15))) {
do { do {
COPY8(op, m_pos); COPY8(op, m_pos);
op += 8; op += 8;
@ -161,7 +181,7 @@ copy_literal_run:
m_pos += 8; m_pos += 8;
} while (op < oe); } while (op < oe);
op = oe; op = oe;
if (HAVE_IP(6)) { if (HAVE_IP(6, 0)) {
state = next; state = next;
COPY4(op, ip); COPY4(op, ip);
op += next; op += next;
@ -169,7 +189,7 @@ copy_literal_run:
continue; continue;
} }
} else { } else {
NEED_OP(t); NEED_OP(t, 0);
do { do {
*op++ = *m_pos++; *op++ = *m_pos++;
} while (op < oe); } while (op < oe);
@ -178,7 +198,7 @@ copy_literal_run:
#endif #endif
{ {
unsigned char *oe = op + t; unsigned char *oe = op + t;
NEED_OP(t); NEED_OP(t, 0);
op[0] = m_pos[0]; op[0] = m_pos[0];
op[1] = m_pos[1]; op[1] = m_pos[1];
op += 2; op += 2;
@ -191,15 +211,15 @@ match_next:
state = next; state = next;
t = next; t = next;
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
if (likely(HAVE_IP(6) && HAVE_OP(4))) { if (likely(HAVE_IP(6, 0) && HAVE_OP(4, 0))) {
COPY4(op, ip); COPY4(op, ip);
op += t; op += t;
ip += t; ip += t;
} else } else
#endif #endif
{ {
NEED_IP(t + 3); NEED_IP(t, 3);
NEED_OP(t); NEED_OP(t, 0);
while (t > 0) { while (t > 0) {
*op++ = *ip++; *op++ = *ip++;
t--; t--;

View File

@ -64,7 +64,7 @@ int string_list_contains(struct string_list *sl, char *str)
{ {
struct string_list *entry; struct string_list *entry;
list_for_each_entry(entry, &sl->list, list) { string_list_for_each_entry(entry, sl) {
if (!strcmp(str, entry->str)) if (!strcmp(str, entry->str))
return 1; return 1;
} }
@ -77,7 +77,7 @@ void string_list_print_by_column(struct string_list *sl)
int len = 0, num, i; int len = 0, num, i;
struct string_list *entry; struct string_list *entry;
list_for_each_entry(entry, &sl->list, list) { string_list_for_each_entry(entry, sl) {
int l = strlen(entry->str) + 4; int l = strlen(entry->str) + 4;
if (l > len) if (l > len)
len = l; len = l;
@ -91,7 +91,7 @@ void string_list_print_by_column(struct string_list *sl)
num = 1; num = 1;
i = 0; i = 0;
list_for_each_entry(entry, &sl->list, list) { string_list_for_each_entry(entry, sl) {
if (!(++i % num)) if (!(++i % num))
printf("%s\n", entry->str); printf("%s\n", entry->str);
else else

View File

@ -140,7 +140,7 @@ static void invalidate_daps(struct DAPS *sector)
* Create the indirect sector with the DAPS entries * Create the indirect sector with the DAPS entries
* @param daps_table Where to store the entries * @param daps_table Where to store the entries
* @param size Size of the whole image in bytes * @param size Size of the whole image in bytes
* @param pers_sector_count Count of sectors to skip after MBR for the persistant environment storage * @param pers_sector_count Count of sectors to skip after MBR for the persistent environment storage
* @return 0 on success * @return 0 on success
* *
* This routine calculates the DAPS entries for the case the whole * This routine calculates the DAPS entries for the case the whole
@ -326,10 +326,10 @@ static int check_for_space(const void *hd_image, off_t size)
} }
/** /**
* Setup the persistant environment storage information * Setup the persistent environment storage information
* @param patch_area Where to patch * @param patch_area Where to patch
* @param pers_sector_start Start sector of the persistant environment storage * @param pers_sector_start Start sector of the persistent environment storage
* @param pers_sector_count Count of sectors for the persistant environment storage * @param pers_sector_count Count of sectors for the persistent environment storage
* @return 0 on success * @return 0 on success
*/ */
static int store_pers_env_info(void *patch_area, uint64_t pers_sector_start, long pers_sector_count) static int store_pers_env_info(void *patch_area, uint64_t pers_sector_start, long pers_sector_count)
@ -355,7 +355,7 @@ static int store_pers_env_info(void *patch_area, uint64_t pers_sector_start, lon
* Prepare the MBR and indirect sector for runtime * Prepare the MBR and indirect sector for runtime
* @param fd_barebox barebox image to use * @param fd_barebox barebox image to use
* @param fd_hd Hard disk image to prepare * @param fd_hd Hard disk image to prepare
* @param pers_sector_count Count of sectors to skip after MBR for the persistant environment storage * @param pers_sector_count Count of sectors to skip after MBR for the persistent environment storage
* @return 0 on success * @return 0 on success
* *
* This routine expects a prepared hard disk image file with a partition table * This routine expects a prepared hard disk image file with a partition table
@ -390,7 +390,7 @@ static int barebox_overlay_mbr(int fd_barebox, int fd_hd, long pers_sector_count
} }
/* /*
* the persistant environment storage is in front of the main * the persistent environment storage is in front of the main
* barebox image. To handle both, we need more space in front of the * barebox image. To handle both, we need more space in front of the
* the first partition. * the first partition.
*/ */
@ -415,7 +415,7 @@ static int barebox_overlay_mbr(int fd_barebox, int fd_hd, long pers_sector_count
/* /*
* embed the barebox main image into the disk drive image, * embed the barebox main image into the disk drive image,
* but keep the persistant environment storage untouched * but keep the persistent environment storage untouched
* (if defined), e.g. store the main image behind this special area. * (if defined), e.g. store the main image behind this special area.
*/ */
memcpy(hd_image + ((pers_sector_count + 1) * SECTOR_SIZE), memcpy(hd_image + ((pers_sector_count + 1) * SECTOR_SIZE),
@ -471,7 +471,7 @@ static void print_usage(const char *pname)
{ {
printf("%s: Preparing a hard disk image for boot with barebox on x86.\n", pname); printf("%s: Preparing a hard disk image for boot with barebox on x86.\n", pname);
printf("Usage is\n %s [options] -m <barebox image> -d <hd image>\n", pname); printf("Usage is\n %s [options] -m <barebox image> -d <hd image>\n", pname);
printf(" [options] are:\n -s <count> sector count of the persistant environment storage\n"); printf(" [options] are:\n -s <count> sector count of the persistent environment storage\n");
printf(" <barebox image> barebox's boot image file\n"); printf(" <barebox image> barebox's boot image file\n");
printf(" <hd image> HD image to store the barebox image\n"); printf(" <hd image> HD image to store the barebox image\n");
printf(" If no '-s <x>' was given, barebox occupies sectors 0 to n, else sector 0 and x+1 to n\n"); printf(" If no '-s <x>' was given, barebox occupies sectors 0 to n, else sector 0 and x+1 to n\n");

1
scripts/tegra/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
cbootimage