diff --git a/arch/arm/boards/efika-mx-smartbook/board.c b/arch/arm/boards/efika-mx-smartbook/board.c index d7c11dc..d7c5681 100644 --- a/arch/arm/boards/efika-mx-smartbook/board.c +++ b/arch/arm/boards/efika-mx-smartbook/board.c @@ -74,9 +74,7 @@ /* Externally powered */ mc13xxx_reg_read(mc, MC13892_REG_CHARGE, &val); - val |= MC13782_CHARGE_ICHRG0 | MC13782_CHARGE_ICHRG1 | - MC13782_CHARGE_ICHRG2 | MC13782_CHARGE_ICHRG3 | - MC13782_CHARGE_CHGAUTOB; + val |= MC13782_CHARGE_ICHRG_FULL | MC13782_CHARGE_CHGAUTOB; mc13xxx_reg_write(mc, MC13892_REG_CHARGE, val); /* power up the system first */ diff --git a/arch/sandbox/include/asm/processor.h b/arch/sandbox/include/asm/processor.h deleted file mode 100644 index 075ec74..0000000 --- a/arch/sandbox/include/asm/processor.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (C) Copyright 2002 - * Daniel Engstr�m, Omicron Ceti AB, daniel@omicron.se - * - * See file CREDITS for list of people who contributed to this - * project. - * - * 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. - * - */ - -#ifndef __ASM_PROCESSOR_H_ -#define __ASM_PROCESSOR_H_ 1 -/* Currently this header is unused in the i386 port - * but some generic files #include - * so this file is a placeholder. */ -#endif diff --git a/arch/sandbox/include/asm/ptrace.h b/arch/sandbox/include/asm/ptrace.h deleted file mode 100644 index 2997587..0000000 --- a/arch/sandbox/include/asm/ptrace.h +++ /dev/null @@ -1 +0,0 @@ -/* dummy */ diff --git a/arch/sandbox/mach-sandbox/include/mach/linux.h b/arch/sandbox/mach-sandbox/include/mach/linux.h index 1e53f69..1f11ed4 100644 --- a/arch/sandbox/mach-sandbox/include/mach/linux.h +++ b/arch/sandbox/mach-sandbox/include/mach/linux.h @@ -30,7 +30,6 @@ extern int sdl_xres; extern int sdl_yres; -int sdl_init(void); void sdl_close(void); int sdl_open(int xres, int yres, int bpp, void* buf); void sdl_stop_timer(void); diff --git a/arch/sandbox/os/sdl.c b/arch/sandbox/os/sdl.c index ec538e9..9a35279 100644 --- a/arch/sandbox/os/sdl.c +++ b/arch/sandbox/os/sdl.c @@ -23,11 +23,6 @@ static void *buffer = NULL; pthread_t th; -int sdl_init(void) -{ - return SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE); -} - static void sdl_copy_buffer(SDL_Surface *screen) { if (SDL_MUSTLOCK(screen)) { @@ -84,7 +79,7 @@ { int flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL; - if (sdl_init() < 0) { + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0) { printf("Could not initialize SDL: %s.\n", SDL_GetError()); return -1; } diff --git a/commands/clk.c b/commands/clk.c index f862c45..47159dd 100644 --- a/commands/clk.c +++ b/commands/clk.c @@ -25,6 +25,7 @@ BAREBOX_CMD_DESC("enable a clock") BAREBOX_CMD_OPTS("CLK") BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP) + BAREBOX_CMD_COMPLETE(clk_name_complete) BAREBOX_CMD_END static int do_clk_disable(int argc, char *argv[]) @@ -48,6 +49,7 @@ BAREBOX_CMD_DESC("disable a clock") BAREBOX_CMD_OPTS("CLK") BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP) + BAREBOX_CMD_COMPLETE(clk_name_complete) BAREBOX_CMD_END static int do_clk_set_rate(int argc, char *argv[]) @@ -77,6 +79,7 @@ BAREBOX_CMD_OPTS("CLK HZ") BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP) BAREBOX_CMD_HELP(cmd_clk_set_rate_help) + BAREBOX_CMD_COMPLETE(clk_name_complete) BAREBOX_CMD_END static int do_clk_get_rate(int argc, char *argv[]) @@ -130,6 +133,7 @@ BAREBOX_CMD_OPTS("[-s VARNAME] CLK") BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP) BAREBOX_CMD_HELP(cmd_clk_get_rate_help) + BAREBOX_CMD_COMPLETE(clk_name_complete) BAREBOX_CMD_END static int do_clk_dump(int argc, char *argv[]) @@ -187,4 +191,5 @@ BAREBOX_CMD_DESC("set parent of a clock") BAREBOX_CMD_OPTS("CLK PARENT") BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP) + BAREBOX_CMD_COMPLETE(clk_name_complete) BAREBOX_CMD_END diff --git a/commands/global.c b/commands/global.c index d21b829..fc68716 100644 --- a/commands/global.c +++ b/commands/global.c @@ -22,6 +22,7 @@ #include #include #include +#include static int do_global(int argc, char *argv[]) { @@ -77,4 +78,5 @@ BAREBOX_CMD_OPTS("[-r] VAR[=VALUE] ...") BAREBOX_CMD_GROUP(CMD_GRP_ENV) BAREBOX_CMD_HELP(cmd_global_help) + BAREBOX_CMD_COMPLETE(nv_global_complete) BAREBOX_CMD_END diff --git a/commands/nv.c b/commands/nv.c index a1fb095..37cdb96 100644 --- a/commands/nv.c +++ b/commands/nv.c @@ -22,6 +22,7 @@ #include #include #include +#include static int do_nv(int argc, char *argv[]) { @@ -90,4 +91,5 @@ BAREBOX_CMD_OPTS("[-r] VAR[=VALUE] ...") BAREBOX_CMD_GROUP(CMD_GRP_ENV) BAREBOX_CMD_HELP(cmd_nv_help) + BAREBOX_CMD_COMPLETE(nv_global_complete) BAREBOX_CMD_END diff --git a/commands/spi.c b/commands/spi.c index 21db9ae..6603b34 100644 --- a/commands/spi.c +++ b/commands/spi.c @@ -68,8 +68,8 @@ return -ENODEV; } - if (spi.chip_select > spi.master->num_chipselect) { - printf("spi chip select (%d)> master num chipselect (%d)\n", + if (spi.chip_select >= spi.master->num_chipselect) { + printf("spi chip select (%d) >= master num chipselect (%d)\n", spi.chip_select, spi.master->num_chipselect); return -EINVAL; } diff --git a/common/globalvar.c b/common/globalvar.c index fb69db9..e75cac9 100644 --- a/common/globalvar.c +++ b/common/globalvar.c @@ -626,3 +626,31 @@ nvvar_save(); } predevshutdown_exitcall(nv_exit); + +static int nv_global_param_complete(struct device_d *dev, struct string_list *sl, + char *instr, int eval) +{ + struct param_d *param; + int len; + + len = strlen(instr); + + list_for_each_entry(param, &dev->parameters, list) { + if (strncmp(instr, param->name, len)) + continue; + + string_list_add_asprintf(sl, "%s%c", + param->name, + eval ? ' ' : '='); + } + + return 0; +} + +int nv_global_complete(struct string_list *sl, char *instr) +{ + nv_global_param_complete(&global_device, sl, instr, 0); + nv_global_param_complete(&nv_device, sl, instr, 0); + + return 0; +} diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 630a84d..15e424d 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include @@ -508,3 +510,23 @@ dump_one(c, verbose, 0); } } + +int clk_name_complete(struct string_list *sl, char *instr) +{ + struct clk *c; + int len; + + if (!instr) + instr = ""; + + len = strlen(instr); + + list_for_each_entry(c, &clks, list) { + if (strncmp(instr, c->name, len)) + continue; + + string_list_add_asprintf(sl, "%s ", c->name); + } + + return COMPLETE_CONTINUE; +} diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index dd90e17..2ea66ed 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -492,13 +492,13 @@ * @vid_hdr_offset: VID header offset * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs * - * This function attaches MTD device @mtd_dev to UBI and assign @ubi_num number + * This function attaches MTD device @mtd_dev to UBI and assigns @ubi_num number * to the newly created UBI device, unless @ubi_num is %UBI_DEV_NUM_AUTO, in * which case this function finds a vacant device number and assigns it * automatically. Returns the new UBI device number in case of success and a * negative error code in case of failure. * - * Note, the invocations of this function has to be serialized by the + * Note, the invocation of this function has to be serialized by the * @ubi_devices_mutex. */ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, @@ -693,7 +693,7 @@ * UBI device is busy and cannot be destroyed, and %-EINVAL if it does not * exist. * - * Note, the invocations of this function has to be serialized by the + * Note, the invocation of this function has to be serialized by the * @ubi_devices_mutex. */ int ubi_detach_mtd_dev(int ubi_num, int anyway) diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c index 77bcd17..6f9ddda 100644 --- a/drivers/net/e1000/main.c +++ b/drivers/net/e1000/main.c @@ -3600,6 +3600,7 @@ e1000_get_ethaddr(edev, edev->ethaddr); /* Set up the function pointers and register the device */ + edev->parent = &pdev->dev; edev->init = e1000_init; edev->recv = e1000_poll; edev->send = e1000_transmit; diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 9a30cb7..0ca359b 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -72,8 +72,12 @@ static int ksz8021_config_init(struct phy_device *phydev) { - const u16 val = KSZPHY_OMSO_B_CAST_OFF | KSZPHY_OMSO_RMII_OVERRIDE; + u16 val; + + val = phy_read(phydev, MII_KSZPHY_OMSO); + val |= KSZPHY_OMSO_B_CAST_OFF; phy_write(phydev, MII_KSZPHY_OMSO, val); + return 0; } diff --git a/drivers/of/base.c b/drivers/of/base.c index 1e6c33d..767d4e1 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1631,7 +1631,7 @@ EXPORT_SYMBOL(of_get_next_available_child); /** - * of_get_next_child - Iterate a node childs + * of_get_next_child - Iterate a node children * @node: parent node * @prev: previous child of the parent node, or NULL to get first * diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index b2253aa..614e136 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -525,7 +525,7 @@ * fdt_add_reserve_map - Add reserve map entries to a devicetree binary * @__fdt: The devicetree blob * - * This adds the reservemap entries previously colllected in + * This adds the reservemap entries previously collected in * of_add_reserve_entry() to a devicetree binary blob. This also * adds the devicetree itself to the reserved list, so after calling * this function the tree should not be relocated anymore. diff --git a/include/command.h b/include/command.h index 2e72780..43ee454 100644 --- a/include/command.h +++ b/include/command.h @@ -89,8 +89,6 @@ #endif /* __ASSEMBLY__ */ -#define Struct_Section __attribute__ ((unused,section (".barebox_cmd"))) - #define BAREBOX_CMD_START(_name) \ extern const struct command __barebox_cmd_##_name; \ const struct command __barebox_cmd_##_name \ diff --git a/include/globalvar.h b/include/globalvar.h index 2a5d8a1..ecd9f1d 100644 --- a/include/globalvar.h +++ b/include/globalvar.h @@ -4,6 +4,7 @@ #include #include #include +#include extern struct device_d global_device; @@ -123,5 +124,6 @@ void nv_var_set_clean(void); int nvvar_save(void); +int nv_global_complete(struct string_list *sl, char *instr); #endif /* __GLOBALVAR_H */ diff --git a/include/linux/clk.h b/include/linux/clk.h index 7a0ee11..8cb9731 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -362,4 +362,8 @@ } #endif +struct string_list; + +int clk_name_complete(struct string_list *sl, char *instr); + #endif diff --git a/include/linux/list.h b/include/linux/list.h index bc63ece..af5edc9 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -2,6 +2,7 @@ #define _LINUX_LIST_H #include /* for NULL */ +#include /* * Simple doubly linked list implementation. diff --git a/include/mfd/mc13892.h b/include/mfd/mc13892.h index c92a462..8b52239 100644 --- a/include/mfd/mc13892.h +++ b/include/mfd/mc13892.h @@ -29,21 +29,43 @@ /* REG_CHARGE */ -#define MC13782_CHARGE_VCHRG0 (1 << 0) -#define MC13782_CHARGE_VCHRG1 (1 << 1) -#define MC13782_CHARGE_VCHRG2 (1 << 2) -#define MC13782_CHARGE_ICHRG0 (1 << 3) -#define MC13782_CHARGE_ICHRG1 (1 << 4) -#define MC13782_CHARGE_ICHRG2 (1 << 5) -#define MC13782_CHARGE_ICHRG3 (1 << 6) +#define MC13782_CHARGE_VCHRG_3800 (0 << 0) +#define MC13782_CHARGE_VCHRG_4100 (1 << 0) +#define MC13782_CHARGE_VCHRG_4150 (2 << 0) +#define MC13782_CHARGE_VCHRG_4200 (3 << 0) +#define MC13782_CHARGE_VCHRG_4250 (4 << 0) +#define MC13782_CHARGE_VCHRG_4300 (5 << 0) +#define MC13782_CHARGE_VCHRG_4375 (6 << 0) +#define MC13782_CHARGE_VCHRG_4450 (7 << 0) +#define MC13782_CHARGE_VCHRG_MASK (7 << 0) +#define MC13782_CHARGE_ICHRG_0 (0 << 3) +#define MC13782_CHARGE_ICHRG_80 (1 << 3) +#define MC13782_CHARGE_ICHRG_240 (2 << 3) +#define MC13782_CHARGE_ICHRG_320 (3 << 3) +#define MC13782_CHARGE_ICHRG_400 (4 << 3) +#define MC13782_CHARGE_ICHRG_480 (5 << 3) +#define MC13782_CHARGE_ICHRG_560 (6 << 3) +#define MC13782_CHARGE_ICHRG_640 (7 << 3) +#define MC13782_CHARGE_ICHRG_720 (8 << 3) +#define MC13782_CHARGE_ICHRG_800 (9 << 3) +#define MC13782_CHARGE_ICHRG_880 (10 << 3) +#define MC13782_CHARGE_ICHRG_960 (11 << 3) +#define MC13782_CHARGE_ICHRG_1040 (12 << 3) +#define MC13782_CHARGE_ICHRG_1200 (13 << 3) +#define MC13782_CHARGE_ICHRG_1600 (14 << 3) +#define MC13782_CHARGE_ICHRG_FULL (15 << 3) +#define MC13782_CHARGE_ICHRG_MASK (15 << 3) #define MC13782_CHARGE_TREN (1 << 7) #define MC13782_CHARGE_ACKLPB (1 << 8) #define MC13782_CHARGE_THCHKB (1 << 9) #define MC13782_CHARGE_FETOVRD (1 << 10) #define MC13782_CHARGE_FETCTRL (1 << 11) #define MC13782_CHARGE_RVRSMODE (1 << 13) -#define MC13782_CHARGE_PLIM0 (1 << 15) -#define MC13782_CHARGE_PLIM1 (1 << 16) +#define MC13782_CHARGE_PLIM_600 (0 << 15) +#define MC13782_CHARGE_PLIM_800 (1 << 15) +#define MC13782_CHARGE_PLIM_1000 (2 << 15) +#define MC13782_CHARGE_PLIM_1200 (3 << 15) +#define MC13782_CHARGE_PLIM_MASK (3 << 15) #define MC13782_CHARGE_PLIMDIS (1 << 17) #define MC13782_CHARGE_CHRGLEDEN (1 << 18) #define MC13782_CHARGE_CHGTMRRST (1 << 19) diff --git a/scripts/gen-dtb-s b/scripts/gen-dtb-s index 40c6085..4215461 100755 --- a/scripts/gen-dtb-s +++ b/scripts/gen-dtb-s @@ -58,7 +58,7 @@ compressed=$(stat $dtb.lzo -c "%s") uncompressed=$(stat $dtb -c "%s") -echo ".section .dtb.rodata.${name}.z,\"a\"" +echo ".section .dtbz.rodata.${name},\"a\"" echo ".balign STRUCT_ALIGNMENT" echo ".global __dtb_z_${name}_start" echo "__dtb_z_${name}_start:"