diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2014-04-04 10:06:22 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-04-04 10:06:22 +0200 |
commit | 245bc10ca5fbd1064445281a13d51481253f1010 (patch) | |
tree | 4997f1b2913909fc631716214779c9911f481abd /drivers | |
parent | a5c3b05b4d087a22a72b5d979a7539e3c5be2917 (diff) | |
parent | 1273cc2d47c92047835d6a43069207d119725e3c (diff) | |
download | barebox-245bc10ca5fbd1064445281a13d51481253f1010.tar.gz barebox-245bc10ca5fbd1064445281a13d51481253f1010.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clocksource/Kconfig | 23 | ||||
-rw-r--r-- | drivers/clocksource/Makefile | 1 | ||||
-rw-r--r-- | drivers/clocksource/dummy.c | 56 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_omap_gpmc.c | 2 | ||||
-rw-r--r-- | drivers/net/ar231x.c | 6 | ||||
-rw-r--r-- | drivers/net/at91_ether.c | 5 | ||||
-rw-r--r-- | drivers/net/designware.c | 5 | ||||
-rw-r--r-- | drivers/of/base.c | 7 | ||||
-rw-r--r-- | drivers/video/imx-ipu-fb.c | 5 | ||||
-rw-r--r-- | drivers/video/imx.c | 5 | ||||
-rw-r--r-- | drivers/video/pxa.c | 5 |
11 files changed, 86 insertions, 34 deletions
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig index 4ef25ec45b..43974f03c2 100644 --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig @@ -14,6 +14,29 @@ config CLOCKSOURCE_CLPS711X bool depends on ARCH_CLPS711X +config CLOCKSOURCE_DUMMY + bool "Enable dummy software-only clocksource" + help + When porting barebox to a new SoC there might be a case + of broken or absent clocksource. This causes barebox serial + console to be non functional. + To solve the problem this software-only clocksource driver is used. + WARNING!!! This clocksource doesn't provide correct timing. + To adjust this clocksource please use CONFIG_CLOCKSOURCE_DUMMY_RATE. + The bigger rate valuest makes clocksource "faster". + It's possible to add this clocksource unconditionally. + This clocksource starts very early (pure_initcall) so + real clocksource will take over. + This can help if initialization order is wrong so that + the time functions are used before the real clocksource + was initialized. + +config CLOCKSOURCE_DUMMY_RATE + int + prompt "dummy clocksource rate" + depends on CLOCKSOURCE_DUMMY + default 1000 + config CLOCKSOURCE_MVEBU bool depends on ARCH_MVEBU diff --git a/drivers/clocksource/Makefile b/drivers/clocksource/Makefile index 25b7f460da..834a15d1e9 100644 --- a/drivers/clocksource/Makefile +++ b/drivers/clocksource/Makefile @@ -2,6 +2,7 @@ obj-$(CONFIG_AMBA_SP804) += amba-sp804.o obj-$(CONFIG_ARM_SMP_TWD) += arm_smp_twd.o obj-$(CONFIG_CLOCKSOURCE_BCM2835) += bcm2835.o obj-$(CONFIG_CLOCKSOURCE_CLPS711X) += clps711x.o +obj-$(CONFIG_CLOCKSOURCE_DUMMY) += dummy.o obj-$(CONFIG_CLOCKSOURCE_MVEBU) += mvebu.o obj-$(CONFIG_CLOCKSOURCE_NOMADIK) += nomadik.o obj-$(CONFIG_CLOCKSOURCE_ORION) += orion.o diff --git a/drivers/clocksource/dummy.c b/drivers/clocksource/dummy.c new file mode 100644 index 0000000000..154a8cd672 --- /dev/null +++ b/drivers/clocksource/dummy.c @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2013 Antony Pavlov <antonynpavlov@gmail.com> + * + * This file is part of barebox. + * 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 version 2 + * as published by the Free Software Foundation. + * + * 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. + * + */ + +#include <common.h> +#include <init.h> +#include <clock.h> + +static uint64_t dummy_counter; + +static uint64_t dummy_cs_read(void) +{ + static int first; + + if (!first) { + pr_warn("Warning: Using dummy clocksource\n"); + first = 1; + } + + dummy_counter += CONFIG_CLOCKSOURCE_DUMMY_RATE; + + return dummy_counter; +} + +static struct clocksource dummy_cs = { + .read = dummy_cs_read, + .mask = CLOCKSOURCE_MASK(32), +}; + +static int clocksource_init(void) +{ + dummy_counter = 0; + + clocks_calc_mult_shift(&dummy_cs.mult, &dummy_cs.shift, + 100000000, NSEC_PER_SEC, 10); + + pr_debug("clocksource_init: mult=%08x, shift=%08x\n", + dummy_cs.mult, dummy_cs.shift); + init_clock(&dummy_cs); + + return 0; +} +pure_initcall(clocksource_init); diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c index 3053a8e891..59712b8119 100644 --- a/drivers/mtd/nand/nand_omap_gpmc.c +++ b/drivers/mtd/nand/nand_omap_gpmc.c @@ -940,7 +940,7 @@ static int gpmc_nand_probe(struct device_d *pdev) switch (pdata->device_width) { case 0: - printk("probe buswidth\n"); + dev_dbg(pdev, "probing buswidth\n"); nand->options |= NAND_BUSWIDTH_AUTO; break; case 8: diff --git a/drivers/net/ar231x.c b/drivers/net/ar231x.c index 5c091140ac..515de17b10 100644 --- a/drivers/net/ar231x.c +++ b/drivers/net/ar231x.c @@ -419,15 +419,9 @@ static int ar231x_eth_probe(struct device_d *dev) return 0; } -static void ar231x_eth_remove(struct device_d *dev) -{ - -} - static struct driver_d ar231x_eth_driver = { .name = "ar231x_eth", .probe = ar231x_eth_probe, - .remove = ar231x_eth_remove, }; static int ar231x_eth_driver_init(void) diff --git a/drivers/net/at91_ether.c b/drivers/net/at91_ether.c index 25924cf7e2..bf2f957a36 100644 --- a/drivers/net/at91_ether.c +++ b/drivers/net/at91_ether.c @@ -357,13 +357,8 @@ static int at91_ether_probe(struct device_d *dev) return 0; } -static void at91_ether_remove(struct device_d *dev) -{ -} - static struct driver_d at91_ether_driver = { .name = "at91_ether", .probe = at91_ether_probe, - .remove = at91_ether_remove, }; device_platform_driver(at91_ether_driver); diff --git a/drivers/net/designware.c b/drivers/net/designware.c index ecb4656e9d..e706f54b31 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -477,10 +477,6 @@ static int dwc_ether_probe(struct device_d *dev) return 0; } -static void dwc_ether_remove(struct device_d *dev) -{ -} - static __maybe_unused struct of_device_id dwc_ether_compatible[] = { { .compatible = "snps,dwmac-3.70a", @@ -493,7 +489,6 @@ static __maybe_unused struct of_device_id dwc_ether_compatible[] = { static struct driver_d dwc_ether_driver = { .name = "designware_eth", .probe = dwc_ether_probe, - .remove = dwc_ether_remove, .of_compatible = DRV_OF_COMPAT(dwc_ether_compatible), }; device_platform_driver(dwc_ether_driver); diff --git a/drivers/of/base.c b/drivers/of/base.c index 104b6daeaf..c440a69e6c 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1841,8 +1841,11 @@ int of_device_is_stdout_path(struct device_d *dev) struct device_node *dn; const char *name; - name = of_get_property(of_chosen, "linux,stdout-path", NULL); - if (name == NULL) + name = of_get_property(of_chosen, "stdout-path", NULL); + if (!name) + name = of_get_property(of_chosen, "linux,stdout-path", NULL); + + if (!name) return 0; dn = of_find_node_by_path(name); diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c index 0ee2b26dcf..abac812cb6 100644 --- a/drivers/video/imx-ipu-fb.c +++ b/drivers/video/imx-ipu-fb.c @@ -1047,14 +1047,9 @@ static int imxfb_probe(struct device_d *dev) return ret; } -static void imxfb_remove(struct device_d *dev) -{ -} - static struct driver_d imx3fb_driver = { .name = "imx-ipu-fb", .probe = imxfb_probe, - .remove = imxfb_remove, }; device_platform_driver(imx3fb_driver); diff --git a/drivers/video/imx.c b/drivers/video/imx.c index 1dd6511d00..b12c09c8cf 100644 --- a/drivers/video/imx.c +++ b/drivers/video/imx.c @@ -580,13 +580,8 @@ static int imxfb_probe(struct device_d *dev) return 0; } -static void imxfb_remove(struct device_d *dev) -{ -} - static struct driver_d imxfb_driver = { .name = "imxfb", .probe = imxfb_probe, - .remove = imxfb_remove, }; device_platform_driver(imxfb_driver); diff --git a/drivers/video/pxa.c b/drivers/video/pxa.c index 529190baec..b4ce3a1bf8 100644 --- a/drivers/video/pxa.c +++ b/drivers/video/pxa.c @@ -536,13 +536,8 @@ static int pxafb_probe(struct device_d *dev) return 0; } -static void pxafb_remove(struct device_d *dev) -{ -} - static struct driver_d pxafb_driver = { .name = "pxafb", .probe = pxafb_probe, - .remove = pxafb_remove, }; device_platform_driver(pxafb_driver); |