9
0
Fork 0

Merge branch 'for-next/misc'

This commit is contained in:
Sascha Hauer 2016-11-14 12:35:49 +01:00
commit f772aa92c2
22 changed files with 113 additions and 56 deletions

View File

@ -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 */

View File

@ -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 <asm/processor.h>
* so this file is a placeholder. */
#endif

View File

@ -1 +0,0 @@
/* dummy */

View File

@ -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);

View File

@ -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;
}

View File

@ -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

View File

@ -22,6 +22,7 @@
#include <globalvar.h>
#include <environment.h>
#include <getopt.h>
#include <complete.h>
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

View File

@ -22,6 +22,7 @@
#include <globalvar.h>
#include <environment.h>
#include <getopt.h>
#include <complete.h>
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

View File

@ -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;
}

View File

@ -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;
}

View File

@ -17,6 +17,8 @@
#include <common.h>
#include <errno.h>
#include <malloc.h>
#include <stringlist.h>
#include <complete.h>
#include <linux/clk.h>
#include <linux/err.h>
@ -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;
}

View File

@ -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)

View File

@ -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;

View File

@ -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;
}

View File

@ -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
*

View File

@ -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.

View File

@ -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 \

View File

@ -4,6 +4,7 @@
#include <param.h>
#include <driver.h>
#include <linux/err.h>
#include <stringlist.h>
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 */

View File

@ -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

View File

@ -2,6 +2,7 @@
#define _LINUX_LIST_H
#include <linux/stddef.h> /* for NULL */
#include <linux/kernel.h>
/*
* Simple doubly linked list implementation.

View File

@ -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)

View File

@ -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:"