diff --git a/arch/arm/boards/efika-mx-smartbook/board.c b/arch/arm/boards/efika-mx-smartbook/board.c index d7c11dc2f..d7c5681db 100644 --- a/arch/arm/boards/efika-mx-smartbook/board.c +++ b/arch/arm/boards/efika-mx-smartbook/board.c @@ -74,9 +74,7 @@ static void efikamx_power_init(struct mc13xxx *mc) /* 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 075ec74da..000000000 --- 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 2997587d8..000000000 --- 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 1e53f69ad..1f11ed449 100644 --- a/arch/sandbox/mach-sandbox/include/mach/linux.h +++ b/arch/sandbox/mach-sandbox/include/mach/linux.h @@ -30,7 +30,6 @@ struct linux_console_data { 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 ec538e9af..9a35279eb 100644 --- a/arch/sandbox/os/sdl.c +++ b/arch/sandbox/os/sdl.c @@ -23,11 +23,6 @@ static SDL_Surface *real_screen; 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 sdl_open(int xres, int yres, int bpp, void* buf) { 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 f862c45b2..47159dddd 100644 --- a/commands/clk.c +++ b/commands/clk.c @@ -25,6 +25,7 @@ BAREBOX_CMD_START(clk_enable) 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_START(clk_disable) 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_START(clk_set_rate) 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_START(clk_get_rate) 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_START(clk_set_parent) 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 d21b82951..fc687169a 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_START(global) 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 a1fb095a1..37cdb9664 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_START(nv) 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 21db9ae23..6603b34b6 100644 --- a/commands/spi.c +++ b/commands/spi.c @@ -68,8 +68,8 @@ static int do_spi(int argc, char *argv[]) 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 fb69db973..e75cac96d 100644 --- a/common/globalvar.c +++ b/common/globalvar.c @@ -626,3 +626,31 @@ static void nv_exit(void) 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 630a84d58..15e424db1 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 @@ void clk_dump(int verbose) 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 dd90e17cb..2ea66ed06 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -492,13 +492,13 @@ static int autoresize(struct ubi_device *ubi, int vol_id) * @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 @@ out_free: * 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 77bcd179a..6f9dddaf2 100644 --- a/drivers/net/e1000/main.c +++ b/drivers/net/e1000/main.c @@ -3600,6 +3600,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *id) 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 9a30cb7e9..0ca359b0b 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -72,8 +72,12 @@ static int kszphy_config_init(struct phy_device *phydev) 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 1e6c33dbf..767d4e1e3 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1631,7 +1631,7 @@ struct device_node *of_get_next_available_child(const struct device_node *node, 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 b2253aa7a..614e136de 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -525,7 +525,7 @@ void of_clean_reserve_map(void) * 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 2e7278099..43ee454f2 100644 --- a/include/command.h +++ b/include/command.h @@ -89,8 +89,6 @@ int run_command(const char *cmd); #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 2a5d8a1a1..ecd9f1d18 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 @@ static inline void dev_param_init_from_nv(struct device_d *dev, const char *name 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 7a0ee110e..8cb9731f1 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -362,4 +362,8 @@ static inline int of_clk_init(struct device_node *root, } #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 bc63ece95..af5edc9a7 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 c92a46244..8b522391b 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 40c60855e..4215461ed 100755 --- a/scripts/gen-dtb-s +++ b/scripts/gen-dtb-s @@ -58,7 +58,7 @@ fi 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:"