summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-05-06 21:36:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-05-06 21:36:13 +0200
commit3975737a7d48b3c767f60be994d55884321d45f9 (patch)
tree8be2f56c4978420e6e4c4b3292e18c61b07a926e /drivers
parent10fb7853084356ef3c6b40ddf21dfb05dbd15691 (diff)
parent6d4afd96fc94a3f2d256ef4e8d7c9687a145a701 (diff)
downloadbarebox-3975737a7d48b3c767f60be994d55884321d45f9.tar.gz
barebox-3975737a7d48b3c767f60be994d55884321d45f9.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/bus.c4
-rw-r--r--drivers/firmware/Kconfig2
-rw-r--r--drivers/firmware/socfpga.c16
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c3
-rw-r--r--drivers/misc/state.c2
-rw-r--r--drivers/mtd/core.c2
-rw-r--r--drivers/mtd/devices/m25p80.c1
-rw-r--r--drivers/mtd/ubi/cdev.c14
-rw-r--r--drivers/net/fec_imx.c5
-rw-r--r--drivers/net/usb/asix.c4
-rw-r--r--drivers/of/barebox.c29
-rw-r--r--drivers/of/of_path.c12
-rw-r--r--drivers/pci/bus.c8
-rw-r--r--drivers/pci/pcie-designware.c11
-rw-r--r--drivers/usb/core/usb.c4
15 files changed, 56 insertions, 61 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index c41e0b0438..1264e40250 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -58,7 +58,7 @@ int device_match(struct device_d *dev, struct driver_d *drv)
return 0;
if (drv->id_table) {
- struct platform_device_id *id = drv->id_table;
+ const struct platform_device_id *id = drv->id_table;
while (id->name) {
if (!strcmp(id->name, dev->name)) {
@@ -74,7 +74,7 @@ int device_match(struct device_d *dev, struct driver_d *drv)
int device_match_of_modalias(struct device_d *dev, struct driver_d *drv)
{
- struct platform_device_id *id = drv->id_table;
+ const struct platform_device_id *id = drv->id_table;
const char *of_modalias = NULL, *p;
int cplen;
const char *compat;
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
index 15465fe5ec..710b500ab0 100644
--- a/drivers/firmware/Kconfig
+++ b/drivers/firmware/Kconfig
@@ -13,5 +13,5 @@ config FIRMWARE_ALTERA_SERIAL
config FIRMWARE_ALTERA_SOCFPGA
bool "Altera SoCFPGA fpga loader"
depends on ARCH_SOCFPGA
-
+ select FIRMWARE
endmenu
diff --git a/drivers/firmware/socfpga.c b/drivers/firmware/socfpga.c
index a5dc6072aa..14a7a14c64 100644
--- a/drivers/firmware/socfpga.c
+++ b/drivers/firmware/socfpga.c
@@ -324,13 +324,27 @@ static int fpgamgr_program_write_buf(struct firmware_handler *fh, const void *bu
const uint32_t *buf32 = buf;
/* write to FPGA Manager AXI data */
- while (size) {
+ while (size >= sizeof(uint32_t)) {
writel(*buf32, mgr->regs_data);
readl(mgr->regs + FPGAMGRREGS_MON_GPIO_EXT_PORTA_ADDRESS);
buf32++;
size -= sizeof(uint32_t);
}
+ if (size) {
+ const uint8_t *buf8 = (const uint8_t *)buf32;
+ uint32_t word = 0;
+
+ while (size--) {
+ word |= *buf8;
+ word <<= 8;
+ buf8++;
+ }
+
+ writel(word, mgr->regs_data);
+ readl(mgr->regs + FPGAMGRREGS_MON_GPIO_EXT_PORTA_ADDRESS);
+ }
+
return 0;
}
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 6d8c85b9d7..4fd3a6f778 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -540,8 +540,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
}
tclk = clk_get_rate(drv_data->clk);
- rc = of_property_read_u32(np, "clock-frequency", &bus_freq);
- if (rc)
+ if (of_property_read_u32(np, "clock-frequency", &bus_freq))
bus_freq = 100000; /* 100kHz by default */
if (!mv64xxx_find_baud_factors(bus_freq, tclk,
diff --git a/drivers/misc/state.c b/drivers/misc/state.c
index f066a836cb..3b07bb93d7 100644
--- a/drivers/misc/state.c
+++ b/drivers/misc/state.c
@@ -41,7 +41,7 @@ static int state_probe(struct device_d *dev)
if (IS_ERR(state))
return PTR_ERR(state);
- ret = of_find_path(np, "backend", &path);
+ ret = of_find_path(np, "backend", &path, 0);
if (ret)
return ret;
diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 431114bab8..1755e7680f 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -488,7 +488,7 @@ static int of_mtd_fixup(struct device_node *root, void *ctx)
struct device_node *np, *part, *tmp;
int ret, i = 0;
- np = of_find_node_by_path(mtd->of_path);
+ np = of_find_node_by_path_from(root, mtd->of_path);
if (!np) {
dev_err(&mtd->class_dev, "Cannot find nodepath %s, cannot fixup\n",
mtd->of_path);
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index 095a4ca093..efef98490b 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -743,6 +743,7 @@ static const struct platform_device_id m25p_ids[] = {
{ "w25q64", INFO(0xef4017, 0, 64 * 1024, 128, SECT_4K) },
{ "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) },
{ "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) },
+ { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) },
/* Catalyst / On Semiconductor -- non-JEDEC */
{ "cat25c11", CAT25_INFO( 16, 8, 16, 1) },
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index dcd138f553..90d5b2dd66 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -25,7 +25,7 @@ static ssize_t ubi_volume_cdev_read(struct cdev *cdev, void *buf, size_t size,
loff_t offp = offset;
int usable_leb_size = vol->usable_leb_size;
- ubi_debug("%s: %zd @ 0x%08llx\n", __func__, size, offset);
+ ubi_debug("%s: %zd @ 0x%08llx", __func__, size, offset);
len = size > usable_leb_size ? usable_leb_size : size;
@@ -38,7 +38,7 @@ static ssize_t ubi_volume_cdev_read(struct cdev *cdev, void *buf, size_t size,
err = ubi_eba_read_leb(ubi, vol, lnum, buf, off, len, 0);
if (err) {
- ubi_err("read error: %s\n", strerror(-err));
+ ubi_err("read error: %s", strerror(-err));
break;
}
off += len;
@@ -68,14 +68,14 @@ static ssize_t ubi_volume_cdev_write(struct cdev* cdev, const void *buf,
if (!priv->written) {
err = ubi_start_update(ubi, vol, vol->used_bytes);
if (err < 0) {
- ubi_err("Cannot start volume update\n");
+ ubi_err("Cannot start volume update");
return err;
}
}
err = ubi_more_update_data(ubi, vol, buf, size);
if (err < 0) {
- ubi_err("Couldnt or partially wrote data \n");
+ ubi_err("Couldnt or partially wrote data");
return err;
}
@@ -117,7 +117,7 @@ static int ubi_volume_cdev_close(struct cdev *cdev)
kfree(buf);
if (err < 0) {
- ubi_err("Couldnt or partially wrote data \n");
+ ubi_err("Couldnt or partially wrote data");
return err;
}
}
@@ -128,7 +128,7 @@ static int ubi_volume_cdev_close(struct cdev *cdev)
err = ubi_check_volume(ubi, vol->vol_id);
if (err < 0) {
- ubi_err("ubi volume check failed: %s\n", strerror(err));
+ ubi_err("ubi volume check failed: %s", strerror(err));
return err;
}
@@ -180,7 +180,7 @@ int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
cdev->priv = priv;
cdev->size = vol->used_bytes;
cdev->dev = &vol->dev;
- ubi_msg("registering %s as /dev/%s\n", vol->name, cdev->name);
+ ubi_msg("registering %s as /dev/%s", vol->name, cdev->name);
ret = devfs_create(cdev);
if (ret) {
kfree(priv);
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 875905a1bf..28d5a7b8bf 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -308,7 +308,10 @@ static int fec_init(struct eth_device *dev)
}
}
- if (fec->interface == PHY_INTERFACE_MODE_RGMII)
+ if (fec->interface == PHY_INTERFACE_MODE_RGMII ||
+ fec->interface == PHY_INTERFACE_MODE_RGMII_ID ||
+ fec->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
+ fec->interface == PHY_INTERFACE_MODE_RGMII_RXID)
rcntl |= 1 << 6;
writel(rcntl, fec->regs + FEC_R_CNTRL);
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 14a8c765f1..7cce5b929e 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -846,6 +846,10 @@ static const struct usb_device_id products [] = {
// LevelOne USB Fast Ethernet Adapter
USB_DEVICE(0x0b95, 0x772b),
.driver_info = &ax88772b_info,
+}, {
+ // DLink DUB-E100 H/W Ver C1
+ USB_DEVICE(0x2001, 0x1a02),
+ .driver_info = &ax88772_info,
},
{ }, // END
};
diff --git a/drivers/of/barebox.c b/drivers/of/barebox.c
index 224674240e..1b3078eb47 100644
--- a/drivers/of/barebox.c
+++ b/drivers/of/barebox.c
@@ -26,42 +26,15 @@
#include <envfs.h>
#include <linux/mtd/mtd.h>
-struct of_partition {
- struct list_head list;
- char *nodepath;
- struct device_d *dev;
- struct device_node *of_partitions;
-};
-
-static LIST_HEAD(of_partition_list);
-
static int environment_probe(struct device_d *dev)
{
char *path;
int ret;
- ret = of_find_path(dev->device_node, "device-path", &path);
+ ret = of_find_path(dev->device_node, "device-path", &path, OF_FIND_PATH_FLAGS_BB);
if (ret)
return ret;
- /*
- * The environment support is not bad block aware, hence we
- * have to use the .bb device. Test if we have a nand device
- * and if yes, append .bb to the filename.
- */
- if (!strncmp(path, "/dev/", 5)) {
- struct cdev *cdev;
- char *cdevname;
-
- cdevname = path + 5;
- cdev = cdev_by_name(cdevname);
- if (cdev && cdev->mtd && mtd_can_have_bb(cdev->mtd)) {
- char *bbpath = asprintf("%s.bb", path);
- free(path);
- path = bbpath;
- }
- }
-
dev_info(dev, "setting default environment path to %s\n", path);
default_environment_path_set(path);
diff --git a/drivers/of/of_path.c b/drivers/of/of_path.c
index df63c5782a..2dc784851d 100644
--- a/drivers/of/of_path.c
+++ b/drivers/of/of_path.c
@@ -21,6 +21,8 @@
#include <malloc.h>
#include <of.h>
+#include <linux/mtd/mtd.h>
+
struct of_path {
struct cdev *cdev;
struct device_d *dev;
@@ -112,6 +114,7 @@ out:
* @propname: the property name of the path description
* @outpath: if this function returns 0 outpath will contain the path belonging
* to the input path description. Must be freed with free().
+ * @flags: use OF_FIND_PATH_FLAGS_BB to return the .bb device if available
*
* paths in the devicetree have the form of a multistring property. The first
* string contains the full path to the physical device containing the path.
@@ -127,11 +130,12 @@ out:
* device-path = &mmc0, "partname:0";
* device-path = &norflash, "partname:barebox-environment";
*/
-int of_find_path(struct device_node *node, const char *propname, char **outpath)
+int of_find_path(struct device_node *node, const char *propname, char **outpath, unsigned flags)
{
struct of_path op = {};
struct device_node *rnode;
const char *path, *str;
+ bool add_bb = false;
int i, ret;
path = of_get_property(node, propname, NULL);
@@ -166,7 +170,11 @@ int of_find_path(struct device_node *node, const char *propname, char **outpath)
if (!op.cdev)
return -ENOENT;
- *outpath = asprintf("/dev/%s", op.cdev->name);
+ if ((flags & OF_FIND_PATH_FLAGS_BB) && op.cdev->mtd &&
+ mtd_can_have_bb(op.cdev->mtd))
+ add_bb = true;
+
+ *outpath = asprintf("/dev/%s%s", op.cdev->name, add_bb ? ".bb" : "");
return 0;
}
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index d6c5496ad7..201675b486 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -27,11 +27,11 @@ static int pci_match(struct device_d *dev, struct driver_d *drv)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct pci_driver *pdrv = to_pci_driver(drv);
- struct pci_device_id *id;
+ const struct pci_device_id *id;
- for (id = (struct pci_device_id *)pdrv->id_table; id->vendor; id++)
+ for (id = pdrv->id_table; id->vendor; id++)
if (pci_match_one_device(id, pdev)) {
- dev->priv = id;
+ pdev->id = id;
return 0;
}
@@ -43,7 +43,7 @@ static int pci_probe(struct device_d *dev)
struct pci_dev *pdev = to_pci_dev(dev);
struct pci_driver *pdrv = to_pci_driver(dev->driver);
- return pdrv->probe(pdev, dev->priv);
+ return pdrv->probe(pdev, pdev->id);
}
static void pci_remove(struct device_d *dev)
diff --git a/drivers/pci/pcie-designware.c b/drivers/pci/pcie-designware.c
index 4edaede10f..4962a19649 100644
--- a/drivers/pci/pcie-designware.c
+++ b/drivers/pci/pcie-designware.c
@@ -350,13 +350,6 @@ static void dw_pcie_prog_viewport_io_outbound(struct pcie_port *pp)
dw_pcie_writel_rc(pp, PCIE_ATU_ENABLE, PCIE_ATU_CR2);
}
-struct pci_bus *get_parent_bus(struct pci_bus *bus)
-{
- struct pci_dev *bridge = container_of(bus->parent, struct pci_dev, dev);
-
- return bridge->bus;
-}
-
static int dw_pcie_rd_other_conf(struct pcie_port *pp, struct pci_bus *bus,
u32 devfn, int where, int size, u32 *val)
{
@@ -367,7 +360,7 @@ static int dw_pcie_rd_other_conf(struct pcie_port *pp, struct pci_bus *bus,
PCIE_ATU_FUNC(PCI_FUNC(devfn));
address = where & ~0x3;
- if (get_parent_bus(bus)->number == pp->root_bus_nr) {
+ if (bus->primary == pp->root_bus_nr) {
dw_pcie_prog_viewport_cfg0(pp, busdev);
ret = dw_pcie_cfg_read(pp->va_cfg0_base + address, where, size,
val);
@@ -392,7 +385,7 @@ static int dw_pcie_wr_other_conf(struct pcie_port *pp, struct pci_bus *bus,
PCIE_ATU_FUNC(PCI_FUNC(devfn));
address = where & ~0x3;
- if (get_parent_bus(bus)->number == pp->root_bus_nr) {
+ if (bus->primary == pp->root_bus_nr) {
dw_pcie_prog_viewport_cfg0(pp, busdev);
ret = dw_pcie_cfg_write(pp->va_cfg0_base + address, where, size,
val);
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index d1c3e0394d..9073fff4be 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -663,7 +663,7 @@ int usb_clear_halt(struct usb_device *dev, int pipe)
result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, 0,
- endp, NULL, 0, USB_CNTL_TIMEOUT * 3);
+ endp, NULL, 0, USB_CNTL_TIMEOUT);
/* don't clear if failed */
if (result < 0)
@@ -748,7 +748,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
USB_REQ_SET_INTERFACE, USB_RECIP_INTERFACE,
alternate, interface, NULL, 0,
- USB_CNTL_TIMEOUT * 5);
+ USB_CNTL_TIMEOUT);
if (ret < 0)
return ret;