summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-07-11 07:58:33 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-07-11 07:58:33 +0200
commitf64075972b8dc4ec4a701506e5fe8075113d3c4a (patch)
treee8c13889eec312fcb7e32ed040017a16204bd005
parente54183d6d4eb575051e67a020094787c113f238d (diff)
parentb06ecabed947ed778ee2f271c0cb0cc8c4483f5d (diff)
downloadbarebox-f64075972b8dc4ec4a701506e5fe8075113d3c4a.tar.gz
barebox-f64075972b8dc4ec4a701506e5fe8075113d3c4a.tar.xz
Merge branch 'for-next/misc'
-rw-r--r--arch/arm/mach-imx/iim.c2
-rw-r--r--commands/menu.c2
-rw-r--r--common/.gitignore1
-rw-r--r--crypto/crc32.c15
-rw-r--r--drivers/clk/clkdev.c4
-rw-r--r--drivers/eeprom/at24.c7
-rw-r--r--drivers/input/Makefile3
-rw-r--r--drivers/mtd/nand/nand_base.c5
-rw-r--r--drivers/net/phy/phy.c3
-rw-r--r--drivers/net/smc911x.c17
-rw-r--r--drivers/usb/gadget/composite.c4
-rw-r--r--drivers/usb/host/ehci-hcd.c8
-rw-r--r--include/.gitignore1
-rw-r--r--include/linux/compiler.h4
-rw-r--r--include/platform_data/eth-smc911x.h2
-rw-r--r--scripts/Makefile.lib7
-rw-r--r--scripts/basic/.gitignore1
17 files changed, 47 insertions, 39 deletions
diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index c3ba67e0b8..6addfed696 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -196,7 +196,7 @@ int imx_iim_read(unsigned int banknum, int offset, void *buf, int count)
if (!imx_iim)
return -ENODEV;
- if (banknum > IIM_NUM_BANKS)
+ if (banknum >= IIM_NUM_BANKS)
return -EINVAL;
bank = iim->bank[banknum];
diff --git a/commands/menu.c b/commands/menu.c
index 9ec2d579b7..e1079fd51e 100644
--- a/commands/menu.c
+++ b/commands/menu.c
@@ -83,7 +83,7 @@ static int do_menu_entry_add(struct cmd_menu *cm)
else
me = menu_add_command_entry(m, cm->description, cm->command,
cm->type);
- if (!me)
+ if (IS_ERR(me))
return PTR_ERR(me);
me->box_state = cm->box_state > 0 ? 1 : 0;
diff --git a/common/.gitignore b/common/.gitignore
index 3d71b7ede1..8e0d6c160e 100644
--- a/common/.gitignore
+++ b/common/.gitignore
@@ -1 +1,2 @@
module.lds
+barebox_default_env*
diff --git a/crypto/crc32.c b/crypto/crc32.c
index 3bff6feb28..232c023adb 100644
--- a/crypto/crc32.c
+++ b/crypto/crc32.c
@@ -24,9 +24,7 @@
#ifdef CONFIG_DYNAMIC_CRC_TABLE
-static int crc_table_empty = 1;
-static ulong crc_table[256];
-static void make_crc_table(void);
+static ulong *crc_table;
/*
Generate a table for a byte-wise 32-bit CRC calculation on the polynomial:
@@ -65,6 +63,8 @@ static void make_crc_table(void)
for (n = 0; n < sizeof(p)/sizeof(char); n++)
poly |= 1L << (31 - p[n]);
+ crc_table = xmalloc(sizeof(ulong) * 256);
+
for (n = 0; n < 256; n++)
{
c = (ulong)n;
@@ -72,7 +72,6 @@ static void make_crc_table(void)
c = c & 1 ? poly ^ (c >> 1) : c >> 1;
crc_table[n] = c;
}
- crc_table_empty = 0;
}
#else
/* ========================================================================
@@ -147,8 +146,8 @@ STATIC uint32_t crc32(uint32_t crc, const void *_buf, unsigned int len)
const unsigned char *buf = _buf;
#ifdef CONFIG_DYNAMIC_CRC_TABLE
- if (crc_table_empty)
- make_crc_table();
+ if (!crc_table)
+ make_crc_table();
#endif
crc = crc ^ 0xffffffffL;
while (len >= 8)
@@ -173,8 +172,8 @@ STATIC uint32_t crc32_no_comp(uint32_t crc, const void *_buf, unsigned int len)
const unsigned char *buf = _buf;
#ifdef CONFIG_DYNAMIC_CRC_TABLE
- if (crc_table_empty)
- make_crc_table();
+ if (!crc_table)
+ make_crc_table();
#endif
while (len >= 8)
{
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
index d9a1c21ae8..1bc5c6daa6 100644
--- a/drivers/clk/clkdev.c
+++ b/drivers/clk/clkdev.c
@@ -181,8 +181,8 @@ struct clk *clk_get(struct device_d *dev, const char *con_id)
if (dev) {
clk = of_clk_get_by_name(dev->device_node, con_id);
- if (!IS_ERR(clk))
- return clk;
+ if (!IS_ERR(clk))
+ return clk;
}
return clk_get_sys(dev_id, con_id);
diff --git a/drivers/eeprom/at24.c b/drivers/eeprom/at24.c
index fd6307d8ac..4ae3776554 100644
--- a/drivers/eeprom/at24.c
+++ b/drivers/eeprom/at24.c
@@ -441,12 +441,7 @@ static int at24_probe(struct device_d *dev)
dev_err(&client->dev, "no index found to name device\n");
goto err_device_name;
}
- devname = basprintf("eeprom%d", err);
- if (!devname) {
- err = -ENOMEM;
- dev_err(&client->dev, "failed to allocate space for device name\n");
- goto err_device_name;
- }
+ devname = xasprintf("eeprom%d", err);
}
at24->cdev.name = devname;
diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index 7d2c1945f7..e694a98d10 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -1,8 +1,7 @@
-obj-$(CONFIG_INPUT) += input.o
+obj-$(CONFIG_INPUT) += input.o keymap.o
obj-$(CONFIG_INPUT_MATRIXKMAP) += matrix-keymap.o
obj-$(CONFIG_KEYBOARD_USB) += usb_kbd.o
obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
obj-$(CONFIG_KEYBOARD_TWL6030) += twl6030_pwrbtn.o
obj-$(CONFIG_KEYBOARD_IMX_KEYPAD) += imx_keypad.o
obj-$(CONFIG_KEYBOARD_QT1070) += qt1070.o
-obj-y += keymap.o
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 670720a284..426ad9bf8b 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -445,10 +445,7 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int getchip,
{
struct nand_chip *chip = mtd->priv;
- if (IS_ENABLED(CONFIG_NAND_BBT)) {
- if (!chip->bbt)
- return chip->block_bad(mtd, ofs, getchip);
-
+ if (IS_ENABLED(CONFIG_NAND_BBT) && chip->bbt) {
/* Return info from the table */
return nand_isbad_bbt(mtd, ofs, allowbbt);
}
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ed69d9b463..13b8324709 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -300,7 +300,8 @@ void phy_unregister_device(struct phy_device *phydev)
phydev->registered = 0;
}
-struct phy_device *of_phy_register_fixed_link(struct device_node *np, struct eth_device *edev)
+static struct phy_device *of_phy_register_fixed_link(struct device_node *np,
+ struct eth_device *edev)
{
struct phy_device *phydev;
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index fe9d1df502..45175bb32b 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -38,7 +38,7 @@ struct smc911x_priv {
struct mii_bus miibus;
void __iomem *base;
- int shift;
+ u32 shift;
int generation;
unsigned int flags;
unsigned int idrev;
@@ -516,6 +516,19 @@ static int smc911x_probe(struct device_d *dev)
priv->shift = pdata->shift;
priv->flags = pdata->flags;
priv->phy_mask = pdata->phy_mask;
+ } else if (IS_ENABLED(CONFIG_OFDEVICE) && dev->device_node) {
+ ret = of_property_read_u32(dev->device_node, "reg-io-width", &val);
+ if (ret)
+ return ret;
+ is_32bit = (val == 4);
+
+ of_property_read_u32(dev->device_node, "reg-shift", &priv->shift);
+
+ if (of_property_read_bool(dev->device_node, "smsc,force-internal-phy"))
+ priv->flags |= SMC911X_FORCE_INTERNAL_PHY;
+
+ if (of_property_read_bool(dev->device_node, "smsc,force-external-phy"))
+ priv->flags |= SMC911X_FORCE_EXTERNAL_PHY;
}
if (is_32bit) {
@@ -562,7 +575,7 @@ static int smc911x_probe(struct device_d *dev)
if (val != 0x87654321) {
dev_err(dev, "no smc911x found on 0x%p (byte_test=0x%08x)\n",
priv->base, val);
- if (((val >> 16) & 0xFFFF) == (val & 0xFFFF)) {
+ if ((((val >> 16) & 0xFFFF) == (val & 0xFFFF)) && is_32bit) {
/*
* This may mean the chip is set
* for 32 bit while the bus is reading 16 bit
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 9e38ac4942..1cfc49d1c5 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -86,7 +86,7 @@ int config_ep_by_speed(struct usb_gadget *g,
struct usb_function *f,
struct usb_ep *_ep)
{
- struct usb_composite_dev *cdev = get_gadget_data(g);
+ struct usb_composite_dev *cdev;
struct usb_endpoint_descriptor *chosen_desc = NULL;
struct usb_descriptor_header **speed_desc = NULL;
@@ -98,6 +98,8 @@ int config_ep_by_speed(struct usb_gadget *g,
if (!g || !f || !_ep)
return -EIO;
+ cdev = get_gadget_data(g);
+
/* select desired speed */
switch (g->speed) {
case USB_SPEED_SUPER:
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index b0bf9225ec..35cf6aa0ad 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -215,7 +215,7 @@ static int ehci_td_buffer(struct qTD *td, void *buf, size_t sz)
static int
ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
- int length, struct devrequest *req)
+ int length, struct devrequest *req, int timeout_ms)
{
struct usb_host *host = dev->host;
struct ehci_priv *ehci = to_ehci(host);
@@ -364,7 +364,7 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
}
/* Wait for TDs to be processed. */
- timeout_val = usb_pipebulk(pipe) ? (SECOND << 2) : (SECOND >> 2);
+ timeout_val = timeout_ms * MSECOND;
start = get_time_ns();
vtd = td;
do {
@@ -893,7 +893,7 @@ submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
dev_dbg(ehci->dev, "non-bulk pipe (type=%lu)", usb_pipetype(pipe));
return -1;
}
- return ehci_submit_async(dev, pipe, buffer, length, NULL);
+ return ehci_submit_async(dev, pipe, buffer, length, NULL, timeout);
}
static int
@@ -913,7 +913,7 @@ submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
dev->speed = USB_SPEED_HIGH;
return ehci_submit_root(dev, pipe, buffer, length, setup);
}
- return ehci_submit_async(dev, pipe, buffer, length, setup);
+ return ehci_submit_async(dev, pipe, buffer, length, setup, timeout);
}
static int
diff --git a/include/.gitignore b/include/.gitignore
index 18e58a752a..f28372a3df 100644
--- a/include/.gitignore
+++ b/include/.gitignore
@@ -1 +1,2 @@
+asm
/config.h
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 020ad16a04..91331dd12f 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -4,8 +4,8 @@
#ifndef __ASSEMBLY__
#ifdef __CHECKER__
-# define __user __attribute__((noderef, address_space(1)))
-# define __kernel __attribute__((address_space(0)))
+# define __user /* no user address space in barebox */
+# define __kernel /* default address space */
# define __safe __attribute__((safe))
# define __force __attribute__((force))
# define __nocast __attribute__((nocast))
diff --git a/include/platform_data/eth-smc911x.h b/include/platform_data/eth-smc911x.h
index 4a802ee52c..c97a2967c9 100644
--- a/include/platform_data/eth-smc911x.h
+++ b/include/platform_data/eth-smc911x.h
@@ -12,7 +12,7 @@
* Pass pointer to this structure as part of device_d -> platform_data
*/
struct smc911x_plat {
- int shift;
+ u32 shift;
unsigned int flags;
unsigned int phy_mask; /* external PHY only: mask out PHYs,
e.g. ~(1 << 5) to use PHY addr 5 */
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 27365d8df8..e55bc27789 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -39,10 +39,9 @@ endif
obj-y += $(obj-pbl-y)
pbl-y += $(obj-pbl-y)
-# for non dirs add pbl- prefix to the target
-# so we recompile the source with custom flags and custom quiet
-__pbl-y := $(notdir $(pbl-y))
-pbl-y := $(patsubst %.o,pbl-%.o,$(__pbl-y))
+# add pbl- prefix to the target
+pbl-y := $(shell echo $(pbl-y) | sed -e 's%\(\([^ \t]\+/\)*\)\([^ \t]*\.o\)%\2pbl-\3%g')
+
# add subdir from $(obj-y) too so we do not need to have the dir define in
# both $(obj-y) and $(pbl-y)
__pbl-y := $(filter-out $(pbl-y), $(filter %/, $(obj-y)))
diff --git a/scripts/basic/.gitignore b/scripts/basic/.gitignore
index a776371a35..dc24f5f4c7 100644
--- a/scripts/basic/.gitignore
+++ b/scripts/basic/.gitignore
@@ -1 +1,2 @@
+docproc
fixdep