diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 45bfb23..66bf3a8 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c @@ -26,7 +26,7 @@ }; static struct device_d sdram_dev = { - .id = 0, + .id = -1, .name = "mem", .map_base = AT91_CHIPSELECT_1, .platform_data = &ram_pdata, diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 8ab40b6..3b034c0 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -14,17 +14,18 @@ LDFLAGS_uboot += -static --gc-sections endif -ifeq ($(incdir-y),) -incdir-y := $(machine-y) -endif -INCDIR := arch-$(incdir-y) - all: $(KBUILD_IMAGE) +machdirs := $(patsubst %,arch/x86/mach-%/,$(machine-y)) +ifeq ($(KBUILD_SRC),) +CPPFLAGS += $(patsubst %,-I%include,$(machdirs)) +else +CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs)) +endif ifneq ($(board-y),) BOARD := arch/x86/boards/$(board-y)/ diff --git a/arch/x86/boards/x86_generic/generic_pc.c b/arch/x86/boards/x86_generic/generic_pc.c index b9c31aa..bfa94b9 100644 --- a/arch/x86/boards/x86_generic/generic_pc.c +++ b/arch/x86/boards/x86_generic/generic_pc.c @@ -58,7 +58,7 @@ extern uint8_t pers_env_drive; /** - * Persistant environment "not used" marker. + * Persistent environment "not used" marker. * Note: Must be in accordance to the value the tool "setup_mbr" writes. */ #define PATCH_AREA_PERS_SIZE_UNUSED 0x000 @@ -74,13 +74,13 @@ register_device(&bios_disk_dev); if (pers_env_size != PATCH_AREA_PERS_SIZE_UNUSED) { - rc = devfs_add_partition("disk0", /* FIXME */ + rc = devfs_add_partition("biosdisk0", pers_env_storage * 512, (unsigned)pers_env_size * 512, DEVFS_PARTITION_FIXED, "env0"); printf("Partition: %d\n", rc); } else - printf("No persistant storage defined\n"); + printf("No persistent storage defined\n"); return 0; } diff --git a/arch/x86/configs/generic_defconfig b/arch/x86/configs/generic_defconfig index ee13e5c..57161f4 100644 --- a/arch/x86/configs/generic_defconfig +++ b/arch/x86/configs/generic_defconfig @@ -2,7 +2,7 @@ CONFIG_STACK_SIZE=0x7000 CONFIG_BROKEN=y CONFIG_EXPERIMENTAL=y -CONFIG_PROMPT="uboot:" +CONFIG_PROMPT="barebox:" CONFIG_LONGHELP=y CONFIG_GLOB=y CONFIG_CMDLINE_EDITING=y diff --git a/arch/x86/include/asm/barebox.lds.h b/arch/x86/include/asm/barebox.lds.h deleted file mode 100644 index 6cbf15f..0000000 --- a/arch/x86/include/asm/barebox.lds.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (C) 2009 Juergen Beisert, Pengutronix - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA - * - */ - -/** - * @file - * @brief Adapt linker script content in accordance to Kconfig settings - */ - -#define INITCALLS \ - KEEP(*(.initcall.0)) \ - KEEP(*(.initcall.1)) \ - KEEP(*(.initcall.2)) \ - KEEP(*(.initcall.3)) \ - KEEP(*(.initcall.4)) \ - KEEP(*(.initcall.5)) \ - KEEP(*(.initcall.6)) \ - KEEP(*(.initcall.7)) - -#define BAREBOX_CMDS KEEP(*(SORT_BY_NAME(.barebox_cmd*))) - -#define BAREBOX_SYMS KEEP(*(__usymtab)) - -/** - * Area in the MBR of the barebox basic boot code. This offset must be in - * accordance to the 'indirect_sector_lba' label. - */ -#define PATCH_AREA 400 - -/** - * Offset where to store the boot drive number (BIOS number, 1 byte) - */ -#define PATCH_AREA_BOOT_DEV 16 - -/** - * Offset where to store information about the persistant environment storage - * It points to an LBA number (8 bytes) and defines the first sector of this - * storage on disk. - */ -#define PATCH_AREA_PERS_START 20 - -/** - * Offset where to store information about the persistant environment storage - * It points to a short number (2 bytes) and defines the sector count of this - * storage on disk. - */ -#define PATCH_AREA_PERS_SIZE 28 - -/** - * Offset where to store information about the persistant environment storage - * drive number (BIOS number, 1 byte) - */ -#define PATCH_AREA_PERS_DRIVE 30 - -/** - * Mark the persistant environment as not used - */ -#define PATCH_AREA_PERS_SIZE_UNUSED 0x000 - -/** - * Mark a DAPS as unused/invalid - */ -#define MARK_DAPS_INVALID 0x0000 - -/** - * Offset of the partition table in an MBR - */ -#define OFFSET_OF_PARTITION_TABLE 446 - -/** - * Offset of the signature in an MBR - */ -#define OFFSET_OF_SIGNATURE 510 - -/** - * Area where to store indirect sector to loop through. Keep this value - * in accordance to the 'indirect_area' label. Note: . - * - * @attention These addresses are real mode ones (seg:offset) - */ -#define INDIRECT_AREA 0x7A00 -#define INDIRECT_SEGMENT 0x0000 - -/** - * Area where to load sectors from disk to. They should start after the - * MBR area and must be in accordance to the offset of the '.bootstrapping' - * section in the linker file. - * - * @attention The address must be a multiple of 512. - */ -#define LOAD_AREA 0x7e00 -#define LOAD_SEGMENT 0x0000 - -/** - * Size of one sector. - */ -#define SECTOR_SIZE 512 diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S index e0919a6..fffc3a5 100644 --- a/arch/x86/lib/barebox.lds.S +++ b/arch/x86/lib/barebox.lds.S @@ -20,7 +20,7 @@ */ #undef i386 -#include +#include OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) diff --git a/arch/x86/mach-i386/include/mach/barebox.lds.h b/arch/x86/mach-i386/include/mach/barebox.lds.h new file mode 100644 index 0000000..81c326e --- /dev/null +++ b/arch/x86/mach-i386/include/mach/barebox.lds.h @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2009 Juergen Beisert, Pengutronix + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + */ + +/** + * @file + * @brief Adapt linker script content in accordance to Kconfig settings + */ + +/** + * Area in the MBR of the barebox basic boot code. This offset must be in + * accordance to the 'indirect_sector_lba' label. + */ +#define PATCH_AREA 400 + +/** + * Offset where to store the boot drive number (BIOS number, 1 byte) + */ +#define PATCH_AREA_BOOT_DEV 16 + +/** + * Offset where to store information about the persistant environment storage + * It points to an LBA number (8 bytes) and defines the first sector of this + * storage on disk. + */ +#define PATCH_AREA_PERS_START 20 + +/** + * Offset where to store information about the persistant environment storage + * It points to a short number (2 bytes) and defines the sector count of this + * storage on disk. + */ +#define PATCH_AREA_PERS_SIZE 28 + +/** + * Offset where to store information about the persistant environment storage + * drive number (BIOS number, 1 byte) + */ +#define PATCH_AREA_PERS_DRIVE 30 + +/** + * Mark the persistant environment as not used + */ +#define PATCH_AREA_PERS_SIZE_UNUSED 0x000 + +/** + * Mark a DAPS as unused/invalid + */ +#define MARK_DAPS_INVALID 0x0000 + +/** + * Offset of the partition table in an MBR + */ +#define OFFSET_OF_PARTITION_TABLE 446 + +/** + * Offset of the signature in an MBR + */ +#define OFFSET_OF_SIGNATURE 510 + +/** + * Area where to store indirect sector to loop through. Keep this value + * in accordance to the 'indirect_area' label. Note: . + * + * @attention These addresses are real mode ones (seg:offset) + */ +#define INDIRECT_AREA 0x7A00 +#define INDIRECT_SEGMENT 0x0000 + +/** + * Area where to load sectors from disk to. They should start after the + * MBR area and must be in accordance to the offset of the '.bootstrapping' + * section in the linker file. + * + * @attention The address must be a multiple of 512. + */ +#define LOAD_AREA 0x7e00 +#define LOAD_SEGMENT 0x0000 + +/** + * Size of one sector. + */ +#define SECTOR_SIZE 512 diff --git a/commands/trigger.c b/commands/trigger.c index 162da97..095f96d 100644 --- a/commands/trigger.c +++ b/commands/trigger.c @@ -79,7 +79,7 @@ led = led_by_name_or_number(argv[optind]); if (!led) { - printf("no such led: %d\n", argv[optind]); + printf("no such led: %s\n", argv[optind]); return 1; } diff --git a/common/module.c b/common/module.c index 29f3eb7..c0ff0f2 100644 --- a/common/module.c +++ b/common/module.c @@ -294,7 +294,6 @@ numsyms = sechdrs[symindex].sh_size / sizeof(Elf32_Sym); sym = (void *)sechdrs[symindex].sh_addr; -#ifdef CONFIG_COMMAND cmdindex = find_sec(ehdr, sechdrs, secstrings, ".barebox_cmd"); if (cmdindex) { struct command *cmd =(struct command *)sechdrs[cmdindex].sh_addr; @@ -303,7 +302,6 @@ cmd++; } } -#endif for (i = 0; i < numsyms; i++) { if (!strcmp(strtab + sym[i].st_name, MODULE_SYMBOL_PREFIX "init_module")) { diff --git a/drivers/ata/bios.c b/drivers/ata/bios.c index 51e2425..3f419cc 100644 --- a/drivers/ata/bios.c +++ b/drivers/ata/bios.c @@ -257,7 +257,6 @@ strcpy(drive_dev->name, "biosdisk"); drive_dev->id = drive - 0x80; - drive_dev->size = 1; drive_dev->map_base = 0; drive_dev->platform_data = p; diff --git a/drivers/mfd/mc13892.c b/drivers/mfd/mc13892.c index 08a439b..b2cc911 100644 --- a/drivers/mfd/mc13892.c +++ b/drivers/mfd/mc13892.c @@ -132,7 +132,7 @@ #endif return -EINVAL; } -EXPORT_SYMBOL(mc13892_reg_write) +EXPORT_SYMBOL(mc13892_reg_write); int mc13892_reg_read(struct mc13892 *mc13892, enum mc13892_reg reg, u32 *val) { @@ -146,7 +146,7 @@ #endif return -EINVAL; } -EXPORT_SYMBOL(mc13892_reg_read) +EXPORT_SYMBOL(mc13892_reg_read); int mc13892_set_bits(struct mc13892 *mc13892, enum mc13892_reg reg, u32 mask, u32 val) { diff --git a/include/asm-generic/barebox.lds.h b/include/asm-generic/barebox.lds.h index fc141a4..2d1dc41 100644 --- a/include/asm-generic/barebox.lds.h +++ b/include/asm-generic/barebox.lds.h @@ -1,5 +1,5 @@ -#if defined CONFIG_ARCH_IMX25 || defined CONFIG_ARCH_IMX35 || defined CONFIG_ARCH_IMX51 +#if defined CONFIG_ARCH_IMX25 || defined CONFIG_ARCH_IMX35 || defined CONFIG_ARCH_IMX51 || defined CONFIG_X86 #include #endif diff --git a/scripts/setupmbr/setupmbr.c b/scripts/setupmbr/setupmbr.c index dd7f38c..74ede94 100644 --- a/scripts/setupmbr/setupmbr.c +++ b/scripts/setupmbr/setupmbr.c @@ -43,7 +43,7 @@ /* include the info from this barebox release */ #include "../../include/generated/utsrelease.h" -#include "../../arch/x86/include/asm/barebox.lds.h" +#include "../../arch/x86/mach-i386/include/mach/barebox.lds.h" /** define to disable integrity tests and debug messages */ #define NDEBUG