* Re: [PATCH] pinctrl: mvebu: sync mpp names to Linux 4.9-rc1
From: Sascha Hauer @ 2016-10-19 10:21 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: barebox
In-Reply-To: <20161018194719.30707-1-u.kleine-koenig@pengutronix.de>
On Tue, Oct 18, 2016 at 09:47:19PM +0200, Uwe Kleine-König wrote:
> Linux changed several mpp names in commits:
>
> a526973e0291 (pinctrl: mvebu: Fix mapping of pin 63 (gpo -> gpio))
> 438881dfddb9 (pinctrl: mvebu: armada-370: fix spi0 pin description)
> bc99357f3690 (pinctrl: mvebu: armada-xp: remove non-existing NAND pins)
> 80b3d04feab5 (pinctrl: mvebu: armada-xp: remove non-existing VDD cpu_pd functions)
> 100dc5d84095 (pinctrl: mvebu: armada-{38x,39x,xp}: normalize naming of DRAM functions)
> 7bd6a26db6f9 (pinctrl: mvebu: armada-{370,375,38x,39x}: normalize dev pins)
> dae5597f253a (pinctrl: mvebu: armada-{370,375,38x,39x,xp}: normalize TDM pins)
> d4974c16ed22 (pinctrl: mvebu: armada-{370,375}: normalize PCIe pins)
> f32f01e1ba6b (pinctrl: mvebu: armada-{370,375}: normalize audio pins)
> a361cbc575d6 (pinctrl: mvebu: armada-{370,xp}: normalize ethernet txclkout pins)
> bfacb5669474 (pinctrl: mvebu: armada-370: align VDD cpu-pd pin naming with datasheet)
> 9e05db29e2ac (pinctrl: mvebu: armada-370: align spi1 clock pin naming)
> 50a7d13d2410 (pinctrl: mvebu: armada-xp: rename spi to spi0)
> 88b355f1e4e5 (pinctrl: mvebu: armada-xp: add spi1 function)
> fb53b61d7768 (pinctrl: mvebu: armada-xp: add nand rb function)
> b19bf3797679 (pinctrl: mvebu: armada-xp: add dram functions)
>
> Adapt the barebox mvebu drivers accordingly.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
>
> this superseeds patch
>
> pinctrl: mvebu: armada-370 fix gpio name for mpp63
>
> which currently sits in next as 8aed8106c2ec.
This is not in next anymore, it's in master since the last release.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: [PATCH] spi: mvebu: make more than one device on a bus work
From: Sascha Hauer @ 2016-10-19 10:14 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: barebox
In-Reply-To: <20161019073045.15747-1-u.kleine-koenig@pengutronix.de>
On Wed, Oct 19, 2016 at 09:30:45AM +0200, Uwe Kleine-König wrote:
> The mvebu socs support up to 8 chip selects. Make use of them.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/spi/mvebu_spi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks
Sascha
>
> diff --git a/drivers/spi/mvebu_spi.c b/drivers/spi/mvebu_spi.c
> index c679e64c4248..335774d4c609 100644
> --- a/drivers/spi/mvebu_spi.c
> +++ b/drivers/spi/mvebu_spi.c
> @@ -361,7 +361,7 @@ static int mvebu_spi_probe(struct device_d *dev)
> master->bus_num = dev->id;
> master->setup = mvebu_spi_setup;
> master->transfer = mvebu_spi_transfer;
> - master->num_chipselect = 1;
> + master->num_chipselect = 8;
>
> ret = spi_register_master(master);
> if (!ret)
> --
> 2.9.3
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: [PATCH] arm: Baltos: setup MPU PLL to run at 600MHz
From: Sascha Hauer @ 2016-10-19 10:07 UTC (permalink / raw)
To: yegorslists; +Cc: barebox
In-Reply-To: <1476793443-27586-1-git-send-email-yegorslists@googlemail.com>
On Tue, Oct 18, 2016 at 02:24:03PM +0200, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> arch/arm/boards/vscom-baltos/lowlevel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks
Sascha
>
> diff --git a/arch/arm/boards/vscom-baltos/lowlevel.c b/arch/arm/boards/vscom-baltos/lowlevel.c
> index 8bce91a..87f2a74 100644
> --- a/arch/arm/boards/vscom-baltos/lowlevel.c
> +++ b/arch/arm/boards/vscom-baltos/lowlevel.c
> @@ -93,7 +93,7 @@ static noinline int baltos_sram_init(void)
> while (__raw_readl(AM33XX_WDT_REG(WWPS)) != 0x0);
>
> /* Setup the PLLs and the clocks for the peripherals */
> - am33xx_pll_init(MPUPLL_M_500, DDRPLL_M_400);
> + am33xx_pll_init(MPUPLL_M_600, DDRPLL_M_400);
> am335x_sdram_init(0x18B, &ddr3_cmd_ctrl, &ddr3_regs, &ddr3_data);
> sdram_size = get_ram_size((void *)0x80000000, (1024 << 20));
> if (sdram_size == SZ_256M)
> --
> 2.1.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* [PATCH] sandbox: eliminate sdl_init()
From: Antony Pavlov @ 2016-10-19 8:44 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/sandbox/mach-sandbox/include/mach/linux.h | 1 -
arch/sandbox/os/sdl.c | 7 +------
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch/sandbox/mach-sandbox/include/mach/linux.h b/arch/sandbox/mach-sandbox/include/mach/linux.h
index 1e53f69..1f11ed4 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 ec538e9..9a35279 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;
}
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* Re: Loading kernel issues
From: Juergen Borleis @ 2016-10-19 7:53 UTC (permalink / raw)
To: Javier Fileiv; +Cc: barebox
In-Reply-To: <CABvwO2A6jNWz7_MOcxxAdJh_fAoV06uA9qk28dKZ5icfV07kQg@mail.gmail.com>
Hi Javier,
On Tuesday 18 October 2016 18:56:03 Javier Fileiv wrote:
> Trying to autoboot from nand, I set my /env/config file like that (and
> after that a "saveenv"). Although it doesn't work automaGically! :)
Can you also send the output of barebox from power on up to the point it falls
into the prompt?
Cheers,
Juergen
--
Pengutronix e.K. | Juergen Borleis |
Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* [PATCH] spi: mvebu: make more than one device on a bus work
From: Uwe Kleine-König @ 2016-10-19 7:30 UTC (permalink / raw)
To: barebox
The mvebu socs support up to 8 chip selects. Make use of them.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/spi/mvebu_spi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/mvebu_spi.c b/drivers/spi/mvebu_spi.c
index c679e64c4248..335774d4c609 100644
--- a/drivers/spi/mvebu_spi.c
+++ b/drivers/spi/mvebu_spi.c
@@ -361,7 +361,7 @@ static int mvebu_spi_probe(struct device_d *dev)
master->bus_num = dev->id;
master->setup = mvebu_spi_setup;
master->transfer = mvebu_spi_transfer;
- master->num_chipselect = 1;
+ master->num_chipselect = 8;
ret = spi_register_master(master);
if (!ret)
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH] mtd: Make UBI detection more robust
From: Sascha Hauer @ 2016-10-19 6:54 UTC (permalink / raw)
To: Barebox List
When we want to detect if a mtd device contains an UBI image then
testing the first block is not enough since it can always happen that
UBI has just erased the block before the power failed during last boot.
Since UBI only ever erases one block at a time and directly writes the
ec header to it afterwards, it shouldn't be necessary to scan the whole
device for UBI data. Scan the first 64 blocks. The first non-empty block
then must contain UBI data, if instead we find foreign data we assume
that no UBI is on that mtd device.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/mtd/core.c | 35 ++++++++++++++++++++++++-----------
1 file changed, 24 insertions(+), 11 deletions(-)
diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 6d04b88..90b800c 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -18,6 +18,7 @@
#include <common.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/mtd.h>
+#include <mtd/mtd-peb.h>
#include <mtd/ubi-user.h>
#include <cmdlinepart.h>
#include <filetype.h>
@@ -622,9 +623,11 @@ static int mtd_detect(struct device_d *dev)
struct mtd_info *mtd = container_of(dev, struct mtd_info, class_dev);
int bufsize = 512;
void *buf;
- int ret;
+ int ret = 0, i;
enum filetype filetype;
- size_t retlen;
+ int npebs = mtd_div_by_eb(mtd->size, mtd);
+
+ npebs = max(npebs, 64);
/*
* Do not try to attach an UBI device if this device has partitions
@@ -636,17 +639,27 @@ static int mtd_detect(struct device_d *dev)
buf = xmalloc(bufsize);
- ret = mtd_read(mtd, 0, bufsize, &retlen, buf);
- if (ret)
- goto out;
+ for (i = 0; i < npebs; i++) {
+ if (mtd_peb_is_bad(mtd, i))
+ continue;
- filetype = file_detect_type(buf, bufsize);
- if (filetype == filetype_ubi) {
- ret = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 20);
- if (ret == -EEXIST)
- ret = 0;
+ ret = mtd_peb_read(mtd, buf, i, 0, 512);
+ if (ret)
+ continue;
+
+ if (mtd_buf_all_ff(buf, 512))
+ continue;
+
+ filetype = file_detect_type(buf, bufsize);
+ if (filetype == filetype_ubi) {
+ ret = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 20);
+ if (ret == -EEXIST)
+ ret = 0;
+ }
+
+ break;
}
-out:
+
free(buf);
return ret;
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH 1/2] linux/list.h: Add missing include
From: Sascha Hauer @ 2016-10-19 6:39 UTC (permalink / raw)
To: Barebox List
linux/list.h needs linux/kernel.h for container_of(). Add it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
include/linux/list.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/list.h b/include/linux/list.h
index bc63ece..af5edc9 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -2,6 +2,7 @@
#define _LINUX_LIST_H
#include <linux/stddef.h> /* for NULL */
+#include <linux/kernel.h>
/*
* Simple doubly linked list implementation.
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH 2/2] complete: Add completion for nv and globalvar commands
From: Sascha Hauer @ 2016-10-19 6:39 UTC (permalink / raw)
To: Barebox List
In-Reply-To: <20161019063921.13247-1-s.hauer@pengutronix.de>
The 'nv' command is often used to create a nv variable
for an existing global variable, so add a command completion
function for this.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
commands/global.c | 2 ++
commands/nv.c | 2 ++
common/globalvar.c | 28 ++++++++++++++++++++++++++++
include/globalvar.h | 2 ++
4 files changed, 34 insertions(+)
diff --git a/commands/global.c b/commands/global.c
index d21b829..fc68716 100644
--- a/commands/global.c
+++ b/commands/global.c
@@ -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
diff --git a/commands/nv.c b/commands/nv.c
index a1fb095..37cdb96 100644
--- a/commands/nv.c
+++ b/commands/nv.c
@@ -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
diff --git a/common/globalvar.c b/common/globalvar.c
index fb69db9..e75cac9 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/include/globalvar.h b/include/globalvar.h
index 2a5d8a1..ecd9f1d 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -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 */
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH] pinctrl: mvebu: sync mpp names to Linux 4.9-rc1
From: Uwe Kleine-König @ 2016-10-18 19:47 UTC (permalink / raw)
To: barebox
Linux changed several mpp names in commits:
a526973e0291 (pinctrl: mvebu: Fix mapping of pin 63 (gpo -> gpio))
438881dfddb9 (pinctrl: mvebu: armada-370: fix spi0 pin description)
bc99357f3690 (pinctrl: mvebu: armada-xp: remove non-existing NAND pins)
80b3d04feab5 (pinctrl: mvebu: armada-xp: remove non-existing VDD cpu_pd functions)
100dc5d84095 (pinctrl: mvebu: armada-{38x,39x,xp}: normalize naming of DRAM functions)
7bd6a26db6f9 (pinctrl: mvebu: armada-{370,375,38x,39x}: normalize dev pins)
dae5597f253a (pinctrl: mvebu: armada-{370,375,38x,39x,xp}: normalize TDM pins)
d4974c16ed22 (pinctrl: mvebu: armada-{370,375}: normalize PCIe pins)
f32f01e1ba6b (pinctrl: mvebu: armada-{370,375}: normalize audio pins)
a361cbc575d6 (pinctrl: mvebu: armada-{370,xp}: normalize ethernet txclkout pins)
bfacb5669474 (pinctrl: mvebu: armada-370: align VDD cpu-pd pin naming with datasheet)
9e05db29e2ac (pinctrl: mvebu: armada-370: align spi1 clock pin naming)
50a7d13d2410 (pinctrl: mvebu: armada-xp: rename spi to spi0)
88b355f1e4e5 (pinctrl: mvebu: armada-xp: add spi1 function)
fb53b61d7768 (pinctrl: mvebu: armada-xp: add nand rb function)
b19bf3797679 (pinctrl: mvebu: armada-xp: add dram functions)
Adapt the barebox mvebu drivers accordingly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,
this superseeds patch
pinctrl: mvebu: armada-370 fix gpio name for mpp63
which currently sits in next as 8aed8106c2ec.
Best regards
Uwe
drivers/pinctrl/mvebu/armada-370.c | 24 +++++-----
drivers/pinctrl/mvebu/armada-xp.c | 93 ++++++++++++++++++++------------------
2 files changed, 60 insertions(+), 57 deletions(-)
diff --git a/drivers/pinctrl/mvebu/armada-370.c b/drivers/pinctrl/mvebu/armada-370.c
index 1c79bd62af92..2fd07a7b8737 100644
--- a/drivers/pinctrl/mvebu/armada-370.c
+++ b/drivers/pinctrl/mvebu/armada-370.c
@@ -50,12 +50,12 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
MPP_FUNCTION(0x2, "uart0", "rxd")),
MPP_MODE(4, "mpp4", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpio", NULL),
- MPP_FUNCTION(0x1, "cpu_pd", "vdd")),
+ MPP_FUNCTION(0x1, "vdd", "cpu-pd")),
MPP_MODE(5, "mpp5", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpo", NULL),
- MPP_FUNCTION(0x1, "ge0", "txclko"),
+ MPP_FUNCTION(0x1, "ge0", "txclkout"),
MPP_FUNCTION(0x2, "uart1", "txd"),
- MPP_FUNCTION(0x4, "spi1", "clk"),
+ MPP_FUNCTION(0x4, "spi1", "sck"),
MPP_FUNCTION(0x5, "audio", "mclk")),
MPP_MODE(6, "mpp6", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpio", NULL),
@@ -66,7 +66,7 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
MPP_MODE(7, "mpp7", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpo", NULL),
MPP_FUNCTION(0x1, "ge0", "txd1"),
- MPP_FUNCTION(0x4, "tdm", "tdx"),
+ MPP_FUNCTION(0x4, "tdm", "dtx"),
MPP_FUNCTION(0x5, "audio", "lrclk")),
MPP_MODE(8, "mpp8", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpio", NULL),
@@ -205,11 +205,11 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
MPP_FUNCTION(0x2, "spi0", "cs0")),
MPP_MODE(34, "mpp34", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpo", NULL),
- MPP_FUNCTION(0x1, "dev", "wen0"),
+ MPP_FUNCTION(0x1, "dev", "we0"),
MPP_FUNCTION(0x2, "spi0", "mosi")),
MPP_MODE(35, "mpp35", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpo", NULL),
- MPP_FUNCTION(0x1, "dev", "oen"),
+ MPP_FUNCTION(0x1, "dev", "oe"),
MPP_FUNCTION(0x2, "spi0", "sck")),
MPP_MODE(36, "mpp36", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpo", NULL),
@@ -346,13 +346,13 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
MPP_FUNCTION(0x1, "dev", "ale1"),
MPP_FUNCTION(0x2, "uart1", "rxd"),
MPP_FUNCTION(0x3, "sata0", "prsnt"),
- MPP_FUNCTION(0x4, "pcie", "rst-out"),
+ MPP_FUNCTION(0x4, "pcie", "rstout"),
MPP_FUNCTION(0x5, "audio", "sdi")),
MPP_MODE(61, "mpp61", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpo", NULL),
- MPP_FUNCTION(0x1, "dev", "wen1"),
+ MPP_FUNCTION(0x1, "dev", "we1"),
MPP_FUNCTION(0x2, "uart1", "txd"),
- MPP_FUNCTION(0x5, "audio", "rclk")),
+ MPP_FUNCTION(0x5, "audio", "lrclk")),
MPP_MODE(62, "mpp62", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpio", NULL),
MPP_FUNCTION(0x1, "dev", "a2"),
@@ -362,17 +362,17 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {
MPP_FUNCTION(0x5, "audio", "mclk"),
MPP_FUNCTION(0x6, "uart0", "cts")),
MPP_MODE(63, "mpp63", armada_370_mpp_ctrl,
- MPP_FUNCTION(0x0, "gpo", NULL),
+ MPP_FUNCTION(0x0, "gpio", NULL),
MPP_FUNCTION(0x1, "spi0", "sck"),
MPP_FUNCTION(0x2, "tclk", NULL)),
MPP_MODE(64, "mpp64", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpio", NULL),
MPP_FUNCTION(0x1, "spi0", "miso"),
- MPP_FUNCTION(0x2, "spi0-1", "cs1")),
+ MPP_FUNCTION(0x2, "spi0", "cs1")),
MPP_MODE(65, "mpp65", armada_370_mpp_ctrl,
MPP_FUNCTION(0x0, "gpio", NULL),
MPP_FUNCTION(0x1, "spi0", "mosi"),
- MPP_FUNCTION(0x2, "spi0-1", "cs2")),
+ MPP_FUNCTION(0x2, "spi0", "cs2")),
};
static struct mvebu_pinctrl_soc_info mv88f6710_pinctrl_info = {
diff --git a/drivers/pinctrl/mvebu/armada-xp.c b/drivers/pinctrl/mvebu/armada-xp.c
index f1bc8b498aac..b9c2aa47f1e5 100644
--- a/drivers/pinctrl/mvebu/armada-xp.c
+++ b/drivers/pinctrl/mvebu/armada-xp.c
@@ -53,7 +53,7 @@ enum armada_xp_variant {
static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
MPP_MODE(0, "mpp0", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x1, "ge0", "txclko", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x1, "ge0", "txclkout", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "d0", V_MV78230_PLUS)),
MPP_MODE(1, "mpp1", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
@@ -102,17 +102,19 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
MPP_MODE(12, "mpp12", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "ge0", "txd4", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x2, "ge1", "clkout", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x2, "ge1", "txclkout", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "d12", V_MV78230_PLUS)),
MPP_MODE(13, "mpp13", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "ge0", "txd5", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "ge1", "txd0", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x3, "spi1", "mosi", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "d13", V_MV78230_PLUS)),
MPP_MODE(14, "mpp14", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "ge0", "txd6", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "ge1", "txd1", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x3, "spi1", "sck", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "d14", V_MV78230_PLUS)),
MPP_MODE(15, "mpp15", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
@@ -123,11 +125,13 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "ge0", "txclk", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "ge1", "txd3", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x3, "spi1", "cs0", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "d16", V_MV78230_PLUS)),
MPP_MODE(17, "mpp17", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "ge0", "col", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "ge1", "txctl", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x3, "spi1", "miso", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "d17", V_MV78230_PLUS)),
MPP_MODE(18, "mpp18", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
@@ -151,7 +155,7 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "ge0", "rxd5", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "ge1", "rxd3", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "mem", "bat", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x3, "dram", "bat", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "d21", V_MV78230_PLUS)),
MPP_MODE(22, "mpp22", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
@@ -168,20 +172,17 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
MPP_MODE(24, "mpp24", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "sata1", "prsnt", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x2, "nf", "bootcs-re", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x3, "tdm", "rst", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "hsync", V_MV78230_PLUS)),
MPP_MODE(25, "mpp25", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "sata0", "prsnt", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x2, "nf", "bootcs-we", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x3, "tdm", "pclk", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "vsync", V_MV78230_PLUS)),
MPP_MODE(26, "mpp26", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x3, "tdm", "fsync", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x4, "lcd", "clk", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "vdd", "cpu1-pd", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x4, "lcd", "clk", V_MV78230_PLUS)),
MPP_MODE(27, "mpp27", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "ptp", "trig", V_MV78230_PLUS),
@@ -196,8 +197,7 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "ptp", "clk", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x3, "tdm", "int0", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x4, "lcd", "ref-clk", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "vdd", "cpu0-pd", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x4, "lcd", "ref-clk", V_MV78230_PLUS)),
MPP_MODE(30, "mpp30", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "sd0", "clk", V_MV78230_PLUS),
@@ -205,23 +205,23 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
MPP_MODE(31, "mpp31", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "sd0", "cmd", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "tdm", "int2", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "vdd", "cpu0-pd", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x3, "tdm", "int2", V_MV78230_PLUS)),
MPP_MODE(32, "mpp32", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "sd0", "d0", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "tdm", "int3", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "vdd", "cpu1-pd", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x3, "tdm", "int3", V_MV78230_PLUS)),
MPP_MODE(33, "mpp33", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "sd0", "d1", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x3, "tdm", "int4", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x4, "mem", "bat", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x4, "dram", "bat", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x5, "dram", "vttctrl", V_MV78230_PLUS)),
MPP_MODE(34, "mpp34", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "sd0", "d2", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "sata0", "prsnt", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "tdm", "int5", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x3, "tdm", "int5", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x4, "dram", "deccerr", V_MV78230_PLUS)),
MPP_MODE(35, "mpp35", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "sd0", "d3", V_MV78230_PLUS),
@@ -229,74 +229,80 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
MPP_VAR_FUNCTION(0x3, "tdm", "int6", V_MV78230_PLUS)),
MPP_MODE(36, "mpp36", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x1, "spi", "mosi", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x1, "spi0", "mosi", V_MV78230_PLUS)),
MPP_MODE(37, "mpp37", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x1, "spi", "miso", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x1, "spi0", "miso", V_MV78230_PLUS)),
MPP_MODE(38, "mpp38", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x1, "spi", "sck", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x1, "spi0", "sck", V_MV78230_PLUS)),
MPP_MODE(39, "mpp39", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x1, "spi", "cs0", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x1, "spi0", "cs0", V_MV78230_PLUS)),
MPP_MODE(40, "mpp40", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x1, "spi", "cs1", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x1, "spi0", "cs1", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "uart2", "cts", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "vdd", "cpu1-pd", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "vga-hsync", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "pcie", "clkreq0", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x5, "pcie", "clkreq0", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x6, "spi1", "cs1", V_MV78230_PLUS)),
MPP_MODE(41, "mpp41", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x1, "spi", "cs2", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x1, "spi0", "cs2", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "uart2", "rts", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x3, "sata1", "prsnt", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "lcd", "vga-vsync", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "pcie", "clkreq1", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x5, "pcie", "clkreq1", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x6, "spi1", "cs2", V_MV78230_PLUS)),
MPP_MODE(42, "mpp42", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "uart2", "rxd", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "uart0", "cts", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x3, "tdm", "int7", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x4, "tdm-1", "timer", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "vdd", "cpu0-pd", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x4, "tdm", "timer", V_MV78230_PLUS)),
MPP_MODE(43, "mpp43", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "uart2", "txd", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "uart0", "rts", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "spi", "cs3", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x3, "spi0", "cs3", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "pcie", "rstout", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "vdd", "cpu2-3-pd", V_MV78460)),
+ MPP_VAR_FUNCTION(0x6, "spi1", "cs3", V_MV78230_PLUS)),
MPP_MODE(44, "mpp44", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "uart2", "cts", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "uart3", "rxd", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "spi", "cs4", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x4, "mem", "bat", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "pcie", "clkreq2", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x3, "spi0", "cs4", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x4, "dram", "bat", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x5, "pcie", "clkreq2", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x6, "spi1", "cs4", V_MV78230_PLUS)),
MPP_MODE(45, "mpp45", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "uart2", "rts", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "uart3", "txd", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "spi", "cs5", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x3, "spi0", "cs5", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x5, "dram", "vttctrl", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x6, "spi1", "cs5", V_MV78230_PLUS)),
MPP_MODE(46, "mpp46", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "uart3", "rts", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "uart1", "rts", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "spi", "cs6", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x3, "spi0", "cs6", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x6, "spi1", "cs6", V_MV78230_PLUS)),
MPP_MODE(47, "mpp47", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x1, "uart3", "cts", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x2, "uart1", "cts", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x3, "spi", "cs7", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x3, "spi0", "cs7", V_MV78230_PLUS),
MPP_VAR_FUNCTION(0x4, "ref", "clkout", V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x5, "pcie", "clkreq3", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x5, "pcie", "clkreq3", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x6, "spi1", "cs7", V_MV78230_PLUS)),
MPP_MODE(48, "mpp48", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x1, "tclk", NULL, V_MV78230_PLUS),
- MPP_VAR_FUNCTION(0x2, "dev", "burst/last", V_MV78230_PLUS)),
+ MPP_VAR_FUNCTION(0x1, "dev", "clkout", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x2, "dev", "burst/last", V_MV78230_PLUS),
+ MPP_VAR_FUNCTION(0x3, "nand", "rb", V_MV78230_PLUS)),
MPP_MODE(49, "mpp49", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
MPP_VAR_FUNCTION(0x1, "dev", "we3", V_MV78260_PLUS)),
@@ -317,16 +323,13 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {
MPP_VAR_FUNCTION(0x1, "dev", "ad19", V_MV78260_PLUS)),
MPP_MODE(55, "mpp55", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
- MPP_VAR_FUNCTION(0x1, "dev", "ad20", V_MV78260_PLUS),
- MPP_VAR_FUNCTION(0x2, "vdd", "cpu0-pd", V_MV78260_PLUS)),
+ MPP_VAR_FUNCTION(0x1, "dev", "ad20", V_MV78260_PLUS)),
MPP_MODE(56, "mpp56", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
- MPP_VAR_FUNCTION(0x1, "dev", "ad21", V_MV78260_PLUS),
- MPP_VAR_FUNCTION(0x2, "vdd", "cpu1-pd", V_MV78260_PLUS)),
+ MPP_VAR_FUNCTION(0x1, "dev", "ad21", V_MV78260_PLUS)),
MPP_MODE(57, "mpp57", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
- MPP_VAR_FUNCTION(0x1, "dev", "ad22", V_MV78260_PLUS),
- MPP_VAR_FUNCTION(0x2, "vdd", "cpu2-3-pd", V_MV78460)),
+ MPP_VAR_FUNCTION(0x1, "dev", "ad22", V_MV78260_PLUS)),
MPP_MODE(58, "mpp58", armada_xp_mpp_ctrl,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_MV78260_PLUS),
MPP_VAR_FUNCTION(0x1, "dev", "ad23", V_MV78260_PLUS)),
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* Re: Loading kernel issues
From: Javier Fileiv @ 2016-10-18 16:56 UTC (permalink / raw)
To: Juergen Borleis; +Cc: barebox
In-Reply-To: <CABvwO2AvfKwc==BhRfw14CzeX4ALwAFp5Zxn1t0MEj2bsn50zQ@mail.gmail.com>
Hi all!
Trying to autoboot from nand, I set my /env/config file like that (and
after that a "saveenv"). Although it doesn't work automaGically! :)
What do you think about this guys?
Thanks a lot!
(I'm gonna try the nfs mounting right now!)
mini2440:/ cat env/config
#!/bin/sh
machine=mini2440
user=
# use 'dhcp' to do dhcp in barebox and in kernel
# use 'none' if you want to skip kernel ip autoconfiguration
ip=dhcp
# or set your networking parameters here
#eth0.ipaddr=a.b.c.d
#eth0.netmask=a.b.c.d
#eth0.gateway=a.b.c.d
eth0.serverip=192.168.0.10
#eth0.ethaddr=a:b:b:d:e:f
# autoboot settings
# can be either 'tftp', 'nfs', 'nand' or 'mmc'
kernel_loc=nand
# can be either 'net', 'nand', 'initrd' or 'mmc'
rootfs_loc=nand
# can be either 'jffs2' or 'ubifs' for flash or 'ext3' for mmc
rootfs_type=jffs2
rootfsimage=root-${machine}.${rootfs_type}
# The image type of the kernel. Can be uimage, zimage, raw, or raw_lzo
#kernelimage_type=zimage
#kernelimage=zImage-${machine}
kernelimage_type=uimage
kernelimage=uImage-$machine
#kernelimage_type=raw
#kernelimage=Image-$machine
#kernelimage_type=raw_lzo
#kernelimage=Image-$machine.lzo
# the name of the barebox image used by the update script
bareboximage=barebox-$machine
# the name of the barebox default environment used by the update script
bareboxenvimage=barebox-environment-$machine
if [ -n $user ]; then
kernelimage="${user}"-"${kernelimage}"
nfsroot="${eth0.serverip}:/home/${user}/nfsroot/${machine}"
rootfsimage="${user}"-"${rootfsimage}"
else
nfsroot="/path/to/nfs/root"
fi
autoboot_timeout=3
if [ -e /dev/nor0 ]; then
nor_parts="512k(barebox)"
# Skip autoboot if not booting from NAND
autoboot_disable=1
fi
#
# "mini2440" kernel parameter
# 0 .. 9 = screen type
# b = backlight enabled
# t = touch enabled
# c = camera enabled
# Note: can be "mini2440= " if nothing of these components are connected
#
bootargs="console=ttySAC0,115200 mini2440=0tbc rootdelay=5"
# NAND boot settings
# Device name used by the kernel
nand_device="nand"
# partition definition in the NAND
nand_parts="512k(barebox),384k(bareboxenv),2048k(kernel),-(root)"
# rootfs's partition number in the NAND
rootfs_mtdblock_nand=3
# used when manually booting with "boot nand" command
rootfs_mtdblock_type=jffs2
# MMC/SD boot settings
# partition number to read the kernel from
# (starting with # 0, Barebox's counting scheme)
kernel_mmc_part=0
# rootfs's partition number
# (starting with # 1, Kernel's counting scheme)
rootfs_mmc_part=2
# used when manually booting with "boot mmc" command
rootfs_mmc_type=ext2
2016-10-18 10:24 GMT+02:00 Javier Fileiv <javier.fileiv@gmail.com>:
> Yes I did it and the values are ok. When I get home I'll send my config file!
>
> Thanks
>
> 2016-10-18 10:17 GMT+02:00 Juergen Borleis <jbe@pengutronix.de>:
>> Hi Javier,
>>
>> On Sunday 16 October 2016 23:06:15 Javier Fileiv wrote:
>>> I've just flashed barebox on my Mini2440. I have 2 questions/issues now
>>>
>>> 1) When trying to load the kernel from TFTP, everything is ok but when
>>> it's trying to mount the rootfs something is not working, even though
>>> I set the rootdelay param to 5 secs.
>>>
>>> 2) I tried also the boot from nand and is working just fine, but there
>>> no is auto boot when reseting the board... it just give me the barebox
>>> prompt each time, and if i run from there boot nand it works OK, but
>>> no automaGically. :)
>>
>> Did you modify the "/env/config"[1] file to define the default boot source?
>>
>> Cheers,
>> Juergen
>>
>> [1] "kernel_loc" and "rootfs_loc"
>>
>> --
>> Pengutronix e.K. | Juergen Borleis |
>> Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* [PATCH] arm: Baltos: setup MPU PLL to run at 600MHz
From: yegorslists @ 2016-10-18 12:24 UTC (permalink / raw)
To: barebox
From: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
arch/arm/boards/vscom-baltos/lowlevel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/boards/vscom-baltos/lowlevel.c b/arch/arm/boards/vscom-baltos/lowlevel.c
index 8bce91a..87f2a74 100644
--- a/arch/arm/boards/vscom-baltos/lowlevel.c
+++ b/arch/arm/boards/vscom-baltos/lowlevel.c
@@ -93,7 +93,7 @@ static noinline int baltos_sram_init(void)
while (__raw_readl(AM33XX_WDT_REG(WWPS)) != 0x0);
/* Setup the PLLs and the clocks for the peripherals */
- am33xx_pll_init(MPUPLL_M_500, DDRPLL_M_400);
+ am33xx_pll_init(MPUPLL_M_600, DDRPLL_M_400);
am335x_sdram_init(0x18B, &ddr3_cmd_ctrl, &ddr3_regs, &ddr3_data);
sdram_size = get_ram_size((void *)0x80000000, (1024 << 20));
if (sdram_size == SZ_256M)
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* Re: Loading kernel issues
From: Javier Fileiv @ 2016-10-18 8:24 UTC (permalink / raw)
To: Juergen Borleis; +Cc: barebox
In-Reply-To: <201610181017.27843.jbe@pengutronix.de>
Yes I did it and the values are ok. When I get home I'll send my config file!
Thanks
2016-10-18 10:17 GMT+02:00 Juergen Borleis <jbe@pengutronix.de>:
> Hi Javier,
>
> On Sunday 16 October 2016 23:06:15 Javier Fileiv wrote:
>> I've just flashed barebox on my Mini2440. I have 2 questions/issues now
>>
>> 1) When trying to load the kernel from TFTP, everything is ok but when
>> it's trying to mount the rootfs something is not working, even though
>> I set the rootdelay param to 5 secs.
>>
>> 2) I tried also the boot from nand and is working just fine, but there
>> no is auto boot when reseting the board... it just give me the barebox
>> prompt each time, and if i run from there boot nand it works OK, but
>> no automaGically. :)
>
> Did you modify the "/env/config"[1] file to define the default boot source?
>
> Cheers,
> Juergen
>
> [1] "kernel_loc" and "rootfs_loc"
>
> --
> Pengutronix e.K. | Juergen Borleis |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: Loading kernel issues
From: Juergen Borleis @ 2016-10-18 8:17 UTC (permalink / raw)
To: Javier Fileiv; +Cc: barebox
In-Reply-To: <CABvwO2ARpHSzYE6Y3JrfFAQ2jEzw3EXfP36goL6kPogcBbNLKQ@mail.gmail.com>
Hi Javier,
On Sunday 16 October 2016 23:06:15 Javier Fileiv wrote:
> I've just flashed barebox on my Mini2440. I have 2 questions/issues now
>
> 1) When trying to load the kernel from TFTP, everything is ok but when
> it's trying to mount the rootfs something is not working, even though
> I set the rootdelay param to 5 secs.
>
> 2) I tried also the boot from nand and is working just fine, but there
> no is auto boot when reseting the board... it just give me the barebox
> prompt each time, and if i run from there boot nand it works OK, but
> no automaGically. :)
Did you modify the "/env/config"[1] file to define the default boot source?
Cheers,
Juergen
[1] "kernel_loc" and "rootfs_loc"
--
Pengutronix e.K. | Juergen Borleis |
Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* [PATCH] ARM: bootm: Fix free_mem calculation when initrd is given
From: Sascha Hauer @ 2016-10-18 7:50 UTC (permalink / raw)
To: Barebox List
When a initrd is given we calculate the next free memory position
as:
free_mem = PAGE_ALIGN(initrd_end);
This is wrong when initrd_end exactly falls on a page boundary.
In this case PAGE_ALIGN() does nothing and free_mem becomes
initrd_end and the following bootm_load_devicetree() and thus
booting fails with -ENOMEM.
Fix this by correctly advancing to the next free memory position.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/lib/bootm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 56663fe..9f3d950 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -158,7 +158,7 @@ static int __do_bootm_linux(struct image_data *data, unsigned long free_mem, int
initrd_start = data->initrd_res->start;
initrd_end = data->initrd_res->end;
initrd_size = resource_size(data->initrd_res);
- free_mem = PAGE_ALIGN(initrd_end);
+ free_mem = PAGE_ALIGN(initrd_end + 1);
}
ret = bootm_load_devicetree(data, free_mem);
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* Re: [PATCH 4/4] mci: add MBR write and read function to block devices
From: Sascha Hauer @ 2016-10-18 6:23 UTC (permalink / raw)
To: Michael Grzeschik; +Cc: barebox
In-Reply-To: <20161017132923.31834-5-m.grzeschik@pengutronix.de>
On Mon, Oct 17, 2016 at 03:29:23PM +0200, Michael Grzeschik wrote:
> With this patch it is possible to write an mbr partition table to the
> mci block device. By setting the device property "dos_partitions" of the
> mmc device node, it is possible to write back the new partition layout
> in the common cmdlinepart notation. The property can also be read back.
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
> drivers/mci/mci-core.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 122 insertions(+)
>
> diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> index 4e176f7..c0013a1 100644
> --- a/drivers/mci/mci-core.c
> +++ b/drivers/mci/mci-core.c
> @@ -33,9 +33,11 @@
> #include <asm-generic/div64.h>
> #include <asm/byteorder.h>
> #include <block.h>
> +#include <fcntl.h>
> #include <disks.h>
> #include <of.h>
> #include <linux/err.h>
> +#include <cmdlinepart.h>
>
> #define MAX_BUFFER_NUMBER 0xffffffff
>
> @@ -1527,6 +1529,122 @@ static void mci_info(struct device_d *dev)
> extract_mtd_year(mci));
> }
>
> +static char *print_size(uint64_t s)
> +{
> + if (!(s & ((1 << 20) - 1)))
> + return basprintf("%lldM", s >> 20);
> + if (!(s & ((1 << 10) - 1)))
> + return basprintf("%lldk", s >> 10);
> + return basprintf("0x%lld", s);
s/lld/llx/
> +}
> +
> +static int print_part(char *buf, int bufsize, struct cdev *cdev, int is_last)
> +{
> + char *size = print_size(cdev->size);
> + int ret;
> +
> + if (!size) {
> + ret = -ENOMEM;
> + goto out;
> + }
> +
> + ret = snprintf(buf, bufsize, "%s(%s)%s", size,
> + cdev->partname,
> + is_last ? "" : ",");
> +out:
> + free(size);
> +
> + return ret;
> +}
> +
> +static int print_parts(char *buf, int bufsize, struct mci *mci)
> +{
> + struct cdev *cdev, *ct;
> + int ret = 0;
> +
> + list_for_each_entry_safe(cdev, ct, &mci->dev.cdevs, devices_list) {
safe_?
> + if ((cdev->flags & DEVFS_IS_PARTITION) &&
> + (cdev->flags & DEVFS_PARTITION_IN_PT)) {
> + int now;
> + int is_last = 0;
> + struct list_head *nh = (cdev)->devices_list.next;
> + struct cdev *next = container_of(nh, typeof(*(cdev)), devices_list);
> +
> + if (list_is_last(&cdev->devices_list, &mci->dev.cdevs) ||
> + !(next->flags & DEVFS_PARTITION_IN_PT))
> + is_last = 1;
Is this test safe? What if the next partition does not have the
DEVFS_PARTITION_IN_PT flag set, but the one after that has? Maybe you
have to count the number of partitions in a first pass.
> +
> + now = print_part(buf, bufsize, cdev, is_last);
> + if (now < 0)
> + return now;
> +
> + if (buf && bufsize) {
> + buf += now;
> + bufsize -= now;
> + }
> + ret += now;
> + }
> + }
> +
> + return ret;
> +}
> +
> +static const char *mci_partition_get(struct device_d *dev, struct param_d *p)
> +{
> + struct mci *mci = container_of(dev, struct mci, dev);
> + int len = 0;
> +
> + free(p->value);
> +
> + len = print_parts(NULL, 0, mci);
> + p->value = xzalloc(len + 1);
> + print_parts(p->value, len + 1, mci);
> +
> + return p->value;
> +}
> +
> +#ifdef CONFIG_BLOCK_WRITE
> +static int mci_partition_set(struct device_d *dev, struct param_d *p, const char *val)
> +{
> + struct mci *mci = container_of(dev, struct mci, dev);
> + struct cdev *cdev, *ct;
> + int ret;
> +
> + if (!val)
> + return -EINVAL;
> +
> + /* remove all partition cdevs with DEVFS_IS_PARTITION set */
> + list_for_each_entry_safe(cdev, ct, &mci->dev.cdevs, devices_list) {
> + if ((cdev->flags & DEVFS_IS_PARTITION) &&
> + (cdev->flags & DEVFS_PARTITION_IN_PT))
> + ret = devfs_del_partition(cdev->name);
> + if (ret)
> + return ret;
> + }
> +
> + /* read back the prepared partition layot from dos_partitions param */
s/layot/layout/
> + ret = cmdlinepart_do_parse(mci->cdevname, val, mci->capacity,
> + CMDLINEPART_ADD_DEVNAME | CMDLINEPART_ADD_TO_PT);
> + if (ret)
> + return ret;
> +
> + /* write the MBR partition layout based on cdevs with DEVFS_IS_PARTITION set */
> + for (int i = 0; i < mci->nr_parts; i++) {
> + struct mci_part *part = &mci->part[i];
> + if (part->area_type == MMC_BLK_DATA_AREA_MAIN) {
> + ret = write_dos_partition_table(&part->blk,
> + &mci->dev.cdevs);
> + if (ret != 0) {
> + dev_warn(&mci->dev, "Could not write partition table\n");
> + return ret;
> + }
> + }
> + }
> +
> + return ret;
> +}
> +#endif
> +
> /**
> * Check if the MCI card is already probed
> * @param mci MCI device instance
> @@ -1786,6 +1904,10 @@ int mci_register(struct mci_host *host)
> mci->param_probe = dev_add_param_bool(&mci->dev, "probe",
> mci_set_probe, NULL, &mci->probe, mci);
>
> +#ifdef CONFIG_BLOCK_WRITE
> + dev_add_param(&mci->dev, "dos_partitions", mci_partition_set, mci_partition_get, 0);
> +#endif
Use IS_ENABLED()
Other than that this code should be attached to parse_partition_table()
rather than making this mci specific.
We probably can safely write a dos partition table to an unpartitioned
device, but should refuse to create/manipulate a dos partition table
when a EFI partition table exists.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: [PATCH 3/4] partitions/dos: add function to write partition table
From: Sascha Hauer @ 2016-10-18 6:07 UTC (permalink / raw)
To: Michael Grzeschik; +Cc: barebox
In-Reply-To: <20161017132923.31834-4-m.grzeschik@pengutronix.de>
Hi Michael,
On Mon, Oct 17, 2016 at 03:29:22PM +0200, Michael Grzeschik wrote:
> The function can be used to write an partition layout to the block device
> based on its cdev layout. Only cdevs with flag DEVFS_PARTITION_IN_PT set
> get written. The function also adds an static offset of 0x200000 to
> ensure the mbr and bootloader will not be overwritten.
>
> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
> common/partitions/dos.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++
> include/disks.h | 1 +
> 2 files changed, 72 insertions(+)
>
> diff --git a/common/partitions/dos.c b/common/partitions/dos.c
> index 5f08e25..d7fa538 100644
> --- a/common/partitions/dos.c
> +++ b/common/partitions/dos.c
> @@ -256,6 +256,77 @@ static void dos_partition(void *buf, struct block_device *blk,
> &dsp->signature, "%08x", dsp);
> }
>
> +static inline void hdimage_setup_chs(unsigned int lba, unsigned char *chs)
> +{
> + const unsigned int hpc = 255;
> + const unsigned int spt = 63;
> + unsigned int s, c;
> +
> + chs[0] = (lba/spt)%hpc;
Please run checkpatch over this. There are some stylistic flaws like
missing whitespaces left and right of operators.
> + c = (lba/(spt * hpc));
> + s = (lba > 0) ?(lba%spt + 1) : 0;
> + chs[1] = ((c & 0x300) >> 2) | (s & 0xff);
> + chs[2] = (c & 0xff);
> +}
> +
> +int write_dos_partition_table(struct block_device *blk, struct list_head *cdevs)
> +{
> + char part_table[6+4*sizeof(struct partition_entry)+2];
> + struct cdev *cdev, *ct;
> + void *buf;
> + int ret;
> + int n = 0;
> + char *ptr;
> +
> + /* prepare partition table entry */
> + ptr = part_table;
> + memset(ptr, 0, sizeof(part_table));
> +
> + /* skip disk signature */
> + ptr += 6;
It's even more important to skip this in the output buffer. This code
should not change the disk signature.
> + list_for_each_entry_safe(cdev, ct, cdevs, devices_list) {
Why _safe? You do not remove entries, do you?
> + if ((cdev->flags & DEVFS_IS_PARTITION) &&
> + (cdev->flags & DEVFS_PARTITION_IN_PT)) {
In a multiline if clause the second line should either start directly
under the opening brace or indented with at least two more tabs than the
opening if(), but using the same indention level as the conditional code
makes it hard to read.
> + struct partition_entry *entry;
Instead of the silent test below, do a:
if (n == 4) {
pr_warn("Only 4 partitions written to MBR\n");
break;
}
> + entry = (struct partition_entry *)
> + (ptr + n * sizeof(struct partition_entry));
> +
> + /* add static offset to skip the mbr and bootloader */
> + cdev->offset += 4096 * SECTOR_SIZE;
> +
> + entry->type = 0x83;
> + entry->partition_start = cdev->offset / SECTOR_SIZE;
> + entry->partition_size = cdev->size / SECTOR_SIZE;
We should have a test if offset and/or size exceed the 32bit limit.
> +
> + hdimage_setup_chs(entry->partition_start,
> + entry->chs_begin);
> + hdimage_setup_chs(entry->partition_start +
> + entry->partition_size - 1,
> + entry->chs_end);
> + n++;
> + }
> + if (n == 4)
> + break;
> + }
> +
> + ptr += 4 * sizeof(struct partition_entry);
> + ptr[0] = 0x55;
> + ptr[1] = 0xaa;
> +
> + buf = read_mbr(blk);
> + if (!buf)
> + return -EIO;
You could move this to the top of the function and directly manipulate
the input buffer.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: [PATCH] of: fix typos
From: Sascha Hauer @ 2016-10-18 5:40 UTC (permalink / raw)
To: Antony Pavlov; +Cc: barebox
In-Reply-To: <20161017115758.7778-1-antonynpavlov@gmail.com>
On Mon, Oct 17, 2016 at 02:57:58PM +0300, Antony Pavlov wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
> drivers/of/base.c | 2 +-
> drivers/of/fdt.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Applied, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: [PATCH v3 1/3] reset: import socfpga-reset driver from linux
From: Sascha Hauer @ 2016-10-18 5:39 UTC (permalink / raw)
To: Steffen Trumtrar; +Cc: barebox
In-Reply-To: <20161017075052.30802-1-s.trumtrar@pengutronix.de>
On Mon, Oct 17, 2016 at 09:50:50AM +0200, Steffen Trumtrar wrote:
> Port the linux v4.8-rc1 reset-socfpga driver to barebox.
>
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
> drivers/reset/Makefile | 1 +
> drivers/reset/reset-socfpga.c | 124 ++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 125 insertions(+)
> create mode 100644 drivers/reset/reset-socfpga.c
Applied, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: Loading kernel issues
From: Sascha Hauer @ 2016-10-18 5:37 UTC (permalink / raw)
To: Javier Fileiv; +Cc: barebox
In-Reply-To: <CABvwO2ARpHSzYE6Y3JrfFAQ2jEzw3EXfP36goL6kPogcBbNLKQ@mail.gmail.com>
Hi Javier,
On Sun, Oct 16, 2016 at 11:06:15PM +0200, Javier Fileiv wrote:
> Hi everyone, I've just flashed barebox on my Mini2440. I have 2
> questions/issues now
>
> 1) When trying to load the kernel from TFTP, everything is ok but when
> it's trying to mount the rootfs something is not working, even though
> I set the rootdelay param to 5 secs.
>
> 2) I tried also the boot from nand and is working just fine, but there
> no is auto boot when reseting the board... it just give me the barebox
> prompt each time, and if i run from there boot nand it works OK, but
> no automaGically. :)
>
> Any suggestions? Thank you very much
>
>
> LOG FOR TFTP BOOT:
>
> mini2440:/ boot tftp
> warning: No MAC address set. Using random address A2:50:1F:24:DF:AB
> phy0: Link is up - 100/Full
> T DHCP client bound to address 192.168.0.15
> TFTP from server 192.168.0.10 ('uImage-mini2440' -> '/dev/ram0.kernel')
> #################################################################
> #################################################################
> #################################################################
> #################################################################
> #################################################################
> ################################################
> booting kernel of type uimage from /dev/ram0.kernel
> Verifying Checksum ... OK
> Image Name: Linux-3.16.7-ptx-master
> Created: 2016-10-13 20:23:14 UTC
> Image Type: <NULL> <NULL> <NULL> (<NULL>)
> Data Size: 1910288 Bytes = 1.8 MB
> Load Address: 30008000
> Entry Point: 30008000
> OK
> commandline: console=ttySAC0,115200 mini2440=0tbc rootdelay=5 ip=dhcp
> root=/dev/nfs nfsroot=/path/to/nfs/root,v3,tcp noinitrd
You have to replace nfsroot=/path/to/nfs/root with some valid path.
Since your dhcp server does not pass a root server ip you'll have to add
that aswell, so your nfsroot should look like
nfsroot=192.168.x.y:/path/to/nfsroot. Try 'edit /env/config' to edit
the parameter to your needs. Do not forget saveenv afterwards.
To boot from Nand also edit /env/config and adjust the kernel_loc and
rootfs_loc variables.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* [PATCH 0/4] Add support to modify mbr partition layout
From: Michael Grzeschik @ 2016-10-17 13:29 UTC (permalink / raw)
To: barebox
This patchset adds the param dos_partitions to the mci device
node. By setting this param with the standard cmdlinepart notation,
it is possible to rewrite the MBR partition layout on runtime.
Michael Grzeschik (4):
partitions: add DEVFS_PARTITION_IN_PT flag
cmdlinepart: add option to set DEVFS_PARTITION_IN_PT flag
partitions/dos: add function to write partition table
mci: add MBR write and read function to block devices
common/partitions.c | 2 +-
common/partitions/dos.c | 71 ++++++++++++++++++++++++++++
drivers/mci/mci-core.c | 122 ++++++++++++++++++++++++++++++++++++++++++++++++
include/cmdlinepart.h | 1 +
include/disks.h | 1 +
include/driver.h | 1 +
lib/cmdlinepart.c | 3 ++
7 files changed, 200 insertions(+), 1 deletion(-)
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* [PATCH 4/4] mci: add MBR write and read function to block devices
From: Michael Grzeschik @ 2016-10-17 13:29 UTC (permalink / raw)
To: barebox
In-Reply-To: <20161017132923.31834-1-m.grzeschik@pengutronix.de>
With this patch it is possible to write an mbr partition table to the
mci block device. By setting the device property "dos_partitions" of the
mmc device node, it is possible to write back the new partition layout
in the common cmdlinepart notation. The property can also be read back.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
drivers/mci/mci-core.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 122 insertions(+)
diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 4e176f7..c0013a1 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -33,9 +33,11 @@
#include <asm-generic/div64.h>
#include <asm/byteorder.h>
#include <block.h>
+#include <fcntl.h>
#include <disks.h>
#include <of.h>
#include <linux/err.h>
+#include <cmdlinepart.h>
#define MAX_BUFFER_NUMBER 0xffffffff
@@ -1527,6 +1529,122 @@ static void mci_info(struct device_d *dev)
extract_mtd_year(mci));
}
+static char *print_size(uint64_t s)
+{
+ if (!(s & ((1 << 20) - 1)))
+ return basprintf("%lldM", s >> 20);
+ if (!(s & ((1 << 10) - 1)))
+ return basprintf("%lldk", s >> 10);
+ return basprintf("0x%lld", s);
+}
+
+static int print_part(char *buf, int bufsize, struct cdev *cdev, int is_last)
+{
+ char *size = print_size(cdev->size);
+ int ret;
+
+ if (!size) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = snprintf(buf, bufsize, "%s(%s)%s", size,
+ cdev->partname,
+ is_last ? "" : ",");
+out:
+ free(size);
+
+ return ret;
+}
+
+static int print_parts(char *buf, int bufsize, struct mci *mci)
+{
+ struct cdev *cdev, *ct;
+ int ret = 0;
+
+ list_for_each_entry_safe(cdev, ct, &mci->dev.cdevs, devices_list) {
+ if ((cdev->flags & DEVFS_IS_PARTITION) &&
+ (cdev->flags & DEVFS_PARTITION_IN_PT)) {
+ int now;
+ int is_last = 0;
+ struct list_head *nh = (cdev)->devices_list.next;
+ struct cdev *next = container_of(nh, typeof(*(cdev)), devices_list);
+
+ if (list_is_last(&cdev->devices_list, &mci->dev.cdevs) ||
+ !(next->flags & DEVFS_PARTITION_IN_PT))
+ is_last = 1;
+
+ now = print_part(buf, bufsize, cdev, is_last);
+ if (now < 0)
+ return now;
+
+ if (buf && bufsize) {
+ buf += now;
+ bufsize -= now;
+ }
+ ret += now;
+ }
+ }
+
+ return ret;
+}
+
+static const char *mci_partition_get(struct device_d *dev, struct param_d *p)
+{
+ struct mci *mci = container_of(dev, struct mci, dev);
+ int len = 0;
+
+ free(p->value);
+
+ len = print_parts(NULL, 0, mci);
+ p->value = xzalloc(len + 1);
+ print_parts(p->value, len + 1, mci);
+
+ return p->value;
+}
+
+#ifdef CONFIG_BLOCK_WRITE
+static int mci_partition_set(struct device_d *dev, struct param_d *p, const char *val)
+{
+ struct mci *mci = container_of(dev, struct mci, dev);
+ struct cdev *cdev, *ct;
+ int ret;
+
+ if (!val)
+ return -EINVAL;
+
+ /* remove all partition cdevs with DEVFS_IS_PARTITION set */
+ list_for_each_entry_safe(cdev, ct, &mci->dev.cdevs, devices_list) {
+ if ((cdev->flags & DEVFS_IS_PARTITION) &&
+ (cdev->flags & DEVFS_PARTITION_IN_PT))
+ ret = devfs_del_partition(cdev->name);
+ if (ret)
+ return ret;
+ }
+
+ /* read back the prepared partition layot from dos_partitions param */
+ ret = cmdlinepart_do_parse(mci->cdevname, val, mci->capacity,
+ CMDLINEPART_ADD_DEVNAME | CMDLINEPART_ADD_TO_PT);
+ if (ret)
+ return ret;
+
+ /* write the MBR partition layout based on cdevs with DEVFS_IS_PARTITION set */
+ for (int i = 0; i < mci->nr_parts; i++) {
+ struct mci_part *part = &mci->part[i];
+ if (part->area_type == MMC_BLK_DATA_AREA_MAIN) {
+ ret = write_dos_partition_table(&part->blk,
+ &mci->dev.cdevs);
+ if (ret != 0) {
+ dev_warn(&mci->dev, "Could not write partition table\n");
+ return ret;
+ }
+ }
+ }
+
+ return ret;
+}
+#endif
+
/**
* Check if the MCI card is already probed
* @param mci MCI device instance
@@ -1786,6 +1904,10 @@ int mci_register(struct mci_host *host)
mci->param_probe = dev_add_param_bool(&mci->dev, "probe",
mci_set_probe, NULL, &mci->probe, mci);
+#ifdef CONFIG_BLOCK_WRITE
+ dev_add_param(&mci->dev, "dos_partitions", mci_partition_set, mci_partition_get, 0);
+#endif
+
if (IS_ERR(mci->param_probe) && PTR_ERR(mci->param_probe) != -ENOSYS) {
ret = PTR_ERR(mci->param_probe);
dev_dbg(&mci->dev, "Failed to add 'probe' parameter to the MCI device\n");
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH 3/4] partitions/dos: add function to write partition table
From: Michael Grzeschik @ 2016-10-17 13:29 UTC (permalink / raw)
To: barebox
In-Reply-To: <20161017132923.31834-1-m.grzeschik@pengutronix.de>
The function can be used to write an partition layout to the block device
based on its cdev layout. Only cdevs with flag DEVFS_PARTITION_IN_PT set
get written. The function also adds an static offset of 0x200000 to
ensure the mbr and bootloader will not be overwritten.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
common/partitions/dos.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++
include/disks.h | 1 +
2 files changed, 72 insertions(+)
diff --git a/common/partitions/dos.c b/common/partitions/dos.c
index 5f08e25..d7fa538 100644
--- a/common/partitions/dos.c
+++ b/common/partitions/dos.c
@@ -256,6 +256,77 @@ static void dos_partition(void *buf, struct block_device *blk,
&dsp->signature, "%08x", dsp);
}
+static inline void hdimage_setup_chs(unsigned int lba, unsigned char *chs)
+{
+ const unsigned int hpc = 255;
+ const unsigned int spt = 63;
+ unsigned int s, c;
+
+ chs[0] = (lba/spt)%hpc;
+ c = (lba/(spt * hpc));
+ s = (lba > 0) ?(lba%spt + 1) : 0;
+ chs[1] = ((c & 0x300) >> 2) | (s & 0xff);
+ chs[2] = (c & 0xff);
+}
+
+int write_dos_partition_table(struct block_device *blk, struct list_head *cdevs)
+{
+ char part_table[6+4*sizeof(struct partition_entry)+2];
+ struct cdev *cdev, *ct;
+ void *buf;
+ int ret;
+ int n = 0;
+ char *ptr;
+
+ /* prepare partition table entry */
+ ptr = part_table;
+ memset(ptr, 0, sizeof(part_table));
+
+ /* skip disk signature */
+ ptr += 6;
+ list_for_each_entry_safe(cdev, ct, cdevs, devices_list) {
+ if ((cdev->flags & DEVFS_IS_PARTITION) &&
+ (cdev->flags & DEVFS_PARTITION_IN_PT)) {
+ struct partition_entry *entry;
+ entry = (struct partition_entry *)
+ (ptr + n * sizeof(struct partition_entry));
+
+ /* add static offset to skip the mbr and bootloader */
+ cdev->offset += 4096 * SECTOR_SIZE;
+
+ entry->type = 0x83;
+ entry->partition_start = cdev->offset / SECTOR_SIZE;
+ entry->partition_size = cdev->size / SECTOR_SIZE;
+
+ hdimage_setup_chs(entry->partition_start,
+ entry->chs_begin);
+ hdimage_setup_chs(entry->partition_start +
+ entry->partition_size - 1,
+ entry->chs_end);
+ n++;
+ }
+ if (n == 4)
+ break;
+ }
+
+ ptr += 4 * sizeof(struct partition_entry);
+ ptr[0] = 0x55;
+ ptr[1] = 0xaa;
+
+ buf = read_mbr(blk);
+ if (!buf)
+ return -EIO;
+
+ /* manipulate block with prepared partition table */
+ memcpy(buf + 440, part_table, sizeof(part_table));
+
+ ret = write_mbr(blk, buf);
+
+ free(buf);
+
+ return ret;
+}
+
static struct partition_parser dos = {
.parse = dos_partition,
.type = filetype_mbr,
diff --git a/include/disks.h b/include/disks.h
index 9932750..432fb23 100644
--- a/include/disks.h
+++ b/include/disks.h
@@ -37,5 +37,6 @@ struct partition_entry {
} __attribute__ ((packed));
extern int parse_partition_table(struct block_device*);
+extern int write_dos_partition_table(struct block_device *blk, struct list_head *cdevs);
#endif /* DISKS_H */
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH 2/4] cmdlinepart: add option to set DEVFS_PARTITION_IN_PT flag
From: Michael Grzeschik @ 2016-10-17 13:29 UTC (permalink / raw)
To: barebox
In-Reply-To: <20161017132923.31834-1-m.grzeschik@pengutronix.de>
With this option it is possible to flag cdev partitions, which will also
be written to the partition table of its backing device.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
include/cmdlinepart.h | 1 +
lib/cmdlinepart.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/include/cmdlinepart.h b/include/cmdlinepart.h
index bf8cdfa..3363a74 100644
--- a/include/cmdlinepart.h
+++ b/include/cmdlinepart.h
@@ -2,6 +2,7 @@
#define __CMD_LINE_PART_H
#define CMDLINEPART_ADD_DEVNAME (1 << 0)
+#define CMDLINEPART_ADD_TO_PT (2 << 0)
int cmdlinepart_do_parse_one(const char *devname, const char *partstr,
const char **endp, loff_t *offset,
diff --git a/lib/cmdlinepart.c b/lib/cmdlinepart.c
index d7d4441..8633e82 100644
--- a/lib/cmdlinepart.c
+++ b/lib/cmdlinepart.c
@@ -81,6 +81,9 @@ int cmdlinepart_do_parse_one(const char *devname, const char *partstr,
end = (char *)(partstr + 2);
}
+ if (partition_flags & CMDLINEPART_ADD_TO_PT)
+ flags |= DEVFS_PARTITION_IN_PT;
+
if (endp)
*endp = end;
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH 1/4] partitions: add DEVFS_PARTITION_IN_PT flag
From: Michael Grzeschik @ 2016-10-17 13:29 UTC (permalink / raw)
To: barebox
In-Reply-To: <20161017132923.31834-1-m.grzeschik@pengutronix.de>
This flag is used to represent the current status of the partition. When
it is set, the current partition layout is also available in the
partition table of the device. We use it after the partition table was
parsed.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
---
common/partitions.c | 2 +-
include/driver.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/partitions.c b/common/partitions.c
index 69a2b1f..62ffaef 100644
--- a/common/partitions.c
+++ b/common/partitions.c
@@ -57,7 +57,7 @@ static int register_one_partition(struct block_device *blk,
dev_dbg(blk->dev, "Registering partition %s on drive %s\n",
partition_name, blk->cdev.name);
cdev = devfs_add_partition(blk->cdev.name,
- start, size, 0, partition_name);
+ start, size, DEVFS_PARTITION_IN_PT, partition_name);
if (IS_ERR(cdev)) {
ret = PTR_ERR(cdev);
goto out;
diff --git a/include/driver.h b/include/driver.h
index 80aa8d8..4ff2f77 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -482,6 +482,7 @@ int cdev_erase(struct cdev *cdev, loff_t count, loff_t offset);
#define DEVFS_PARTITION_READONLY (1U << 1)
#define DEVFS_IS_PARTITION (1 << 2)
#define DEVFS_IS_CHARACTER_DEV (1 << 3)
+#define DEVFS_PARTITION_IN_PT (1 << 4)
struct cdev *devfs_add_partition(const char *devname, loff_t offset,
loff_t size, unsigned int flags, const char *name);
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox