* Re: [PATCH] boot: add '-w' parameter to usage help text
From: Sascha Hauer @ 2016-10-12 6:48 UTC (permalink / raw)
To: yegorslists; +Cc: barebox
In-Reply-To: <1476085720-2752-1-git-send-email-yegorslists@googlemail.com>
On Mon, Oct 10, 2016 at 09:48:40AM +0200, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> commands/boot.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks
Sascha
>
> diff --git a/commands/boot.c b/commands/boot.c
> index 102ca07..5d81d79 100644
> --- a/commands/boot.c
> +++ b/commands/boot.c
> @@ -141,7 +141,7 @@ BAREBOX_CMD_HELP_END
> BAREBOX_CMD_START(boot)
> .cmd = do_boot,
> BAREBOX_CMD_DESC("boot from script, device, ...")
> - BAREBOX_CMD_OPTS("[-vdlmt] [BOOTSRC...]")
> + BAREBOX_CMD_OPTS("[-vdlmwt] [BOOTSRC...]")
> BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
> BAREBOX_CMD_HELP(cmd_boot_help)
> BAREBOX_CMD_END
> --
> 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
* Re: [PATCH 1/5] fs: squashfs: port lzo compression support from kernel
From: Yegor Yefremov @ 2016-10-12 6:26 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox, Enrico Jorns
In-Reply-To: <20161004193416.awslsajyeeze4aiu@pengutronix.de>
On Tue, Oct 4, 2016 at 9:34 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Tue, Oct 04, 2016 at 12:10:44PM +0200, Enrico Jorns wrote:
>> This ports lzo_wrapper from kernel code and adds some minimal adaptions
>> to make squashfs lzo compression work in barebox.
>>
>> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
>> ---
>> fs/squashfs/Kconfig | 14 +++++
>> fs/squashfs/Makefile | 1 +
>> fs/squashfs/lzo_wrapper.c | 128 ++++++++++++++++++++++++++++++++++++++++++++++
>> include/linux/lzo.h | 47 +++++++++++++++++
>> 4 files changed, 190 insertions(+)
>> create mode 100644 fs/squashfs/lzo_wrapper.c
>> create mode 100644 include/linux/lzo.h
>>
>> diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig
>> index dc25d93..d8ee554 100644
>> --- a/fs/squashfs/Kconfig
>> +++ b/fs/squashfs/Kconfig
>> @@ -17,6 +17,20 @@ menuconfig FS_SQUASHFS
>> embedded systems where low overhead is needed. Further information
>> and tools are available from http://squashfs.sourceforge.net.
>>
>> +config SQUASHFS_LZO
>> + bool "Include support for LZO compressed file systems"
>> + default y
>> + depends on FS_SQUASHFS
>> + select LZO_DECOMPRESS
>> + help
>> + Saying Y here includes support for reading Squashfs file systems
>> + compressed with LZO compression. LZO compression is mainly
>> + aimed at embedded systems with slower CPUs where the overheads
>> + of zlib are too high.
>> +
>> + LZO is not the standard compression used in Squashfs and so most
>> + file systems will be readable without selecting this option.
>> +
>> config SQUASHFS_XZ
>> bool "Include support for XZ compressed file systems"
>> default y
>> diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile
>> index c0d024c..447e15e 100644
>> --- a/fs/squashfs/Makefile
>> +++ b/fs/squashfs/Makefile
>> @@ -11,3 +11,4 @@ obj-y += inode.o
>> obj-y += namei.o
>> obj-y += super.o
>> obj-$(CONFIG_SQUASHFS_XZ) += xz_wrapper.o
>> +obj-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o
>> diff --git a/fs/squashfs/lzo_wrapper.c b/fs/squashfs/lzo_wrapper.c
>> new file mode 100644
>> index 0000000..b457955
>> --- /dev/null
>> +++ b/fs/squashfs/lzo_wrapper.c
>> @@ -0,0 +1,128 @@
>> +/*
>> + * Squashfs - a compressed read only filesystem for Linux
>> + *
>> + * Copyright (c) 2010 LG Electronics
>> + * Chan Jeong <chan.jeong@lge.com>
>> + *
>> + * This program is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU General Public License
>> + * as published by the Free Software Foundation; either version 2,
>> + * or (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU General Public License
>> + * along with this program; if not, write to the Free Software
>> + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
>> + *
>> + * lzo_wrapper.c
>> + */
>> +
>> +#include <linux/mutex.h>
>> +#include <linux/lzo.h>
>> +#include <types.h>
>> +
>> +#include "squashfs_fs.h"
>> +#include "squashfs_fs_sb.h"
>> +#include "squashfs.h"
>> +#include "decompressor.h"
>> +#include "page_actor.h"
>> +
>> +struct squashfs_lzo {
>> + void *input;
>> + void *output;
>> +};
>> +
>> +static void *lzo_init(struct squashfs_sb_info *msblk, void *buff)
>> +{
>> + int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE);
>> +
>> + struct squashfs_lzo *stream = kzalloc(sizeof(*stream), GFP_KERNEL);
>> + if (stream == NULL)
>> + goto failed;
>> + stream->input = vmalloc(block_size);
>> + if (stream->input == NULL)
>> + goto failed;
>> + stream->output = vmalloc(block_size);
>> + if (stream->output == NULL)
>> + goto failed2;
>> +
>> + return stream;
>> +
>> +failed2:
>> + vfree(stream->input);
>> +failed:
>> + ERROR("Failed to allocate lzo workspace\n");
>> + kfree(stream);
>> + return ERR_PTR(-ENOMEM);
>> +}
>> +
>> +
>> +static void lzo_free(void *strm)
>> +{
>> + struct squashfs_lzo *stream = strm;
>> +
>> + if (stream) {
>> + vfree(stream->input);
>> + vfree(stream->output);
>> + }
>> + kfree(stream);
>> +}
>> +
>> +
>> +static int lzo_uncompress(struct squashfs_sb_info *msblk, void *strm,
>> + char **bh, int b, int offset, int length,
>> + struct squashfs_page_actor *output)
>> +{
>> + struct squashfs_lzo *stream = strm;
>> + void *buff = stream->input, *data;
>> + int avail, i, bytes = length, res;
>> + size_t out_len = output->length;
>> +
>> + for (i = 0; i < b; i++) {
>> + avail = min(bytes, msblk->devblksize - offset);
>> + memcpy(buff, bh[i] + offset, avail);
>> + buff += avail;
>> + bytes -= avail;
>> + offset = 0;
>> + kfree(bh[i]);
>> + }
>> +
>> + res = lzo1x_decompress_safe(stream->input, (size_t)length,
>> + stream->output, &out_len);
>> + if (res != LZO_E_OK)
>> + goto failed;
>> +
>> + res = bytes = (int)out_len;
>> + data = squashfs_first_page(output);
>> + buff = stream->output;
>> + while (data) {
>> + if (bytes <= PAGE_CACHE_SIZE) {
>> + memcpy(data, buff, bytes);
>> + break;
>> + } else {
>> + memcpy(data, buff, PAGE_CACHE_SIZE);
>> + buff += PAGE_CACHE_SIZE;
>> + bytes -= PAGE_CACHE_SIZE;
>> + data = squashfs_next_page(output);
>> + }
>> + }
>> + squashfs_finish_page(output);
>> +
>> + return res;
>> +
>> +failed:
>> + return -EIO;
>> +}
>> +
>> +const struct squashfs_decompressor squashfs_lzo_comp_ops = {
>> + .init = lzo_init,
>> + .free = lzo_free,
>> + .decompress = lzo_uncompress,
>> + .id = LZO_COMPRESSION,
>> + .name = "lzo",
>> + .supported = 1
>> +};
>> diff --git a/include/linux/lzo.h b/include/linux/lzo.h
>
> We already have include/lzo.h with the same content, no need to add it
> again.
>
> 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
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* [PATCH] ubi: fix spelling
From: yegorslists @ 2016-10-12 5:52 UTC (permalink / raw)
To: barebox
From: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
drivers/mtd/ubi/build.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 5953e36..a7a679a 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -492,13 +492,13 @@ static int autoresize(struct ubi_device *ubi, int vol_id)
* @vid_hdr_offset: VID header offset
* @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs
*
- * This function attaches MTD device @mtd_dev to UBI and assign @ubi_num number
+ * This function attaches MTD device @mtd_dev to UBI and assigns @ubi_num number
* to the newly created UBI device, unless @ubi_num is %UBI_DEV_NUM_AUTO, in
* which case this function finds a vacant device number and assigns it
* automatically. Returns the new UBI device number in case of success and a
* negative error code in case of failure.
*
- * Note, the invocations of this function has to be serialized by the
+ * Note, the invocation of this function has to be serialized by the
* @ubi_devices_mutex.
*/
int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
@@ -695,7 +695,7 @@ out_free:
* UBI device is busy and cannot be destroyed, and %-EINVAL if it does not
* exist.
*
- * Note, the invocations of this function has to be serialized by the
+ * Note, the invocation of this function has to be serialized by the
* @ubi_devices_mutex.
*/
int ubi_detach_mtd_dev(int ubi_num, int anyway)
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH] sandbox: drop unused header files
From: Antony Pavlov @ 2016-10-11 9:06 UTC (permalink / raw)
To: barebox
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/sandbox/include/asm/processor.h | 25 -------------------------
arch/sandbox/include/asm/ptrace.h | 1 -
2 files changed, 26 deletions(-)
delete mode 100644 arch/sandbox/include/asm/processor.h
delete mode 100644 arch/sandbox/include/asm/ptrace.h
diff --git a/arch/sandbox/include/asm/processor.h b/arch/sandbox/include/asm/processor.h
deleted file mode 100644
index 075ec74..0000000
--- a/arch/sandbox/include/asm/processor.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef __ASM_PROCESSOR_H_
-#define __ASM_PROCESSOR_H_ 1
-/* Currently this header is unused in the i386 port
- * but some generic files #include <asm/processor.h>
- * so this file is a placeholder. */
-#endif
diff --git a/arch/sandbox/include/asm/ptrace.h b/arch/sandbox/include/asm/ptrace.h
deleted file mode 100644
index 2997587..0000000
--- a/arch/sandbox/include/asm/ptrace.h
+++ /dev/null
@@ -1 +0,0 @@
-/* dummy */
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH] mtd: ubi: Fix scrubbing during attach
From: Sascha Hauer @ 2016-10-11 6:45 UTC (permalink / raw)
To: Barebox List
ensure_wear_leveling() is called at the end of ubi_wl_init() and may
come to the decision to scrub some blocks. In the Kernel this is done
in a separate thread, but in barebox we do this synchronously. The
problem is that during ubi_wl_init() the EBA system is not yet
initialized (ubi_eba_init() is not yet called), so the wear level worker
hits a NULL pointer deref when the fastmap needs to be updated and
ubi_write_fastmap() accesses vol->eba_tbl.
Solve this by honoring the ubi->thread_enabled flag which is only set
to true when UBI is sufficiently initialized. This means we now can
have multiple works queued, so we can no longer simply do one work when
queued, but instead have to continue to do work until all work is done.
The best place to do so is a ubi_thread() function which behaves similar
to the Kernel function with the same name, but is called synchronously
in barebox. To make sure that the initially queued works are done, the
call to (no-op) wake_up_process() at the end of ubi_attach_mtd_dev()
is replaced with a call to ubi_thread().
While at it also honor the ubi->ro_mode flag to make sure we do not do
any wear leveling work on readonly UBI devices.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/mtd/ubi/build.c | 4 +++-
drivers/mtd/ubi/ubi.h | 2 +-
drivers/mtd/ubi/wl.c | 25 ++++++++++++++++++++++++-
3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 5953e36..617c63e 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -668,7 +668,9 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
* checks @ubi->thread_enabled. Otherwise we may fail to wake it up.
*/
ubi->thread_enabled = 1;
- wake_up_process(ubi->bgt_thread);
+
+ /* No threading, call ubi_thread directly */
+ ubi_thread(ubi);
ubi_devices[ubi_num] = ubi;
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 89e3347..1f0ad38 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -788,7 +788,7 @@ int ubi_wl_flush(struct ubi_device *ubi, int vol_id, int lnum);
int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum);
int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai);
void ubi_wl_close(struct ubi_device *ubi);
-int ubi_thread(void *u);
+int ubi_thread(struct ubi_device *ubi);
struct ubi_wl_entry *ubi_wl_get_fm_peb(struct ubi_device *ubi, int anchor);
int ubi_wl_put_fm_peb(struct ubi_device *ubi, struct ubi_wl_entry *used_e,
int lnum, int torture);
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index f24c219..a368bf9 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -523,7 +523,7 @@ static void __schedule_ubi_work(struct ubi_device *ubi, struct ubi_work *wrk)
ubi->works_count += 1;
/* No threading in barebox, so do work synchronously */
- do_work(ubi);
+ ubi_thread(ubi);
}
/**
@@ -1329,6 +1329,29 @@ static void tree_destroy(struct ubi_device *ubi, struct rb_root *root)
}
/**
+ * ubi_thread - UBI background thread.
+ * @ubi: UBI device description object
+ *
+ * for barebox this is no thread, instead it's called synchronously from
+ * __schedule_ubi_work(). This is the place that makes sure all pending
+ * work is done.
+ */
+int ubi_thread(struct ubi_device *ubi)
+{
+ while (!list_empty(&ubi->works)) {
+ if (!ubi->thread_enabled)
+ return 0;
+
+ if (ubi->ro_mode)
+ return 0;
+
+ do_work(ubi);
+ }
+
+ return 0;
+}
+
+/**
* shutdown_work - shutdown all pending works.
* @ubi: UBI device description object
*/
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* Re: [PATCH 0/2] H100 support
From: Sascha Hauer @ 2016-10-11 5:01 UTC (permalink / raw)
To: Lucas Stach; +Cc: barebox
In-Reply-To: <20160930160401.21147-1-l.stach@pengutronix.de>
On Fri, Sep 30, 2016 at 06:03:59PM +0200, Lucas Stach wrote:
> This adds support for the H100 baseboard. Series is on top of -next
> as the base DT for this board is only in Linux 4.8.
>
> Lucas Stach (2):
> ARM: microsom: use imx6q_barebox_entry
> ARM: imx6: add support for Auvidea H100
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: why UBI static volumes are flagged as DEVFS_IS_CHARACTER_DEV
From: Teresa Remmet @ 2016-10-10 8:17 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox, iw3gtf
In-Reply-To: <20161007072720.u3c7k6qv4pphlihz@pengutronix.de>
Hello Sascha,
Am Freitag, den 07.10.2016, 09:27 +0200 schrieb Sascha Hauer:
> On Thu, Oct 06, 2016 at 10:17:27AM +0200, Teresa Remmet wrote:
> > Hello Giorgio,
> >
> > Am Mittwoch, den 05.10.2016, 15:23 +0200 schrieb iw3gtf@arcor.de:
> > > Hi,
> > >
> > > I noticed that the commit id c087e0804f0290e9886899e8a3cccb07c4ce088b flagged static
> > > UBI volumes as DEVFS_IS_CHARACTER_DEV.
> > >
> > > A consequence of this flag is that commands like:
> > >
> > > # cp /dev/nand0.ubi_volumes.ubi.my_static_vol file
> > >
> > > will not work because the cp command will see a src file (the static UBI volume) with a size
> > > of -1 (FILE_SIZE_STREAM) and keep on reading from the volume until a flood of
> > > "UBI assert failed in ubi_eba_read_leb at 359" asserts comes out of the console.
> > >
> > > I tried to comment out the flag assignment, just to see what happen:
> > >
> > > int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
> > > {
> > > ...
> > > cdev->size = vol->used_bytes;
> > >
> > > // if (vol->vol_type == UBI_STATIC_VOLUME)
> > > // cdev->flags = DEVFS_IS_CHARACTER_DEV;
> > >
> > > cdev->dev = &vol->dev;
> > > ...
> > >
> > > and then the cp command worked than as expected.
> > >
> > > Could someone shortly confirm that the DEVFS_IS_CHARACTER_DEV flag for static UBI volumes
> > > is really needed (to avoid some other problems that my superficial test does not triggers) ?
> >
> > the size of a static ubi volume device is equal to the image size you
> > flashed. When you create a new static ubi volume the size is 0, as it is
> > empty.
> > We need the chardev flag to be able to update the static ubi volume or
> > barebox will complain that there is not enough space.
>
> Then I think we need another solution for that. UBI volumes are clearly
> not character devices, so we shouldn't set this flag to work around
> other issues we have.
Yes, you are write using the character dev flag is more a work around.
Which now brings up other problems like dumping the data back from
flash.
>
> Currently devfs_truncate is implemented like:
>
> static int devfs_truncate(struct device_d *dev, FILE *f, ulong size)
> {
> if (f->fsdev->dev.num_resources < 1)
> return -ENOSPC;
> if (size > resource_size(&f->fsdev->dev.resource[0]))
> return -ENOSPC;
> return 0;
> }
>
> Maybe we need an optional cdev->ops->truncate() to let the UBI volumes be
> able to overwrite this behaviour?
Truncate sounds like a better way. But UBI itself is not a filesystem.
So I do not see a good place to overwrite it on a first look.
I will try to look into this deeper next week.
Regards,
Teresa
>
> Sascha
>
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* [PATCH] boot: add '-w' parameter to usage help text
From: yegorslists @ 2016-10-10 7:48 UTC (permalink / raw)
To: barebox
From: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
commands/boot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commands/boot.c b/commands/boot.c
index 102ca07..5d81d79 100644
--- a/commands/boot.c
+++ b/commands/boot.c
@@ -141,7 +141,7 @@ BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(boot)
.cmd = do_boot,
BAREBOX_CMD_DESC("boot from script, device, ...")
- BAREBOX_CMD_OPTS("[-vdlmt] [BOOTSRC...]")
+ BAREBOX_CMD_OPTS("[-vdlmwt] [BOOTSRC...]")
BAREBOX_CMD_GROUP(CMD_GRP_BOOT)
BAREBOX_CMD_HELP(cmd_boot_help)
BAREBOX_CMD_END
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* v2016.10.0
From: Sascha Hauer @ 2016-10-10 6:46 UTC (permalink / raw)
To: Barebox List
Hi All,
We have an October release. This time we have Rockchip RK3288 support
and improved i.MX50 support. Lucas brought us several ARM64 compile
fixes to make his autobuilder green again, thanks Lucas ;)
Sascha
----------------------------------------------------------------
Aleksey Kuleshov (4):
fix double free
properly remove menu entry
clarify strim function description
rework menu so that it can support multiline titles
Alexander Kurz (13):
mfd mc13xxx: add MC13892_REVISION_2_4
Kconfig: defaultenv-2 select CMD_TEST
scripts: imx-usb-loader: do DCD only once, cleanup
scripts: imx-image: DCD check command for v2 only
scripts: imx-usb-loader: enable DCD 16-bit write for hdr v1
scripts: imx-usb-loader: structured DCD v1 element access
scripts: imx-usb-loader: cleanup DCD v2 processing
ARM: add common definitions for i.MX50 SOC
scripts: imx: add support for i.MX50
ARM: i.MX clock: cleanup imx50 incompatibilities
ARM: i.MX drivers: enable i.MX50 where already supported
Add i.MX50 support
ARM i.MX50: Add iomux definitions for non-DT board implementations
Andrey Gusakov (1):
video: tc358767: add eDP video encoder driver
Andrey Smirnov (1):
arm: Add both .lds files to CLEAN_FILES unconditionally
Antony Pavlov (3):
MIPS: dts: reuse TP-LINK MR3020 dts file from linux
net: phy: of_phy_register_fixed_link(): drop redundant initialization
Documentation: imd: fix sphinx warning
Christian Hemp (1):
commands/Kconfig: fix typo in CMD_OF_FIXUP_STATUS help
Enrico Jorns (3):
clk: socfpga: add divider registers to the main pll outputs
commands: saveenv: exit on invalid option
commands: exit on invalid option
Lucas Stach (10):
serial: arm_dcc: depend on !CPU_V8
mfd: syscon: drop EXPORT_SYMBOL for static function
video: tc358767: depend on EDID helpers
arm64: select ARM_EXCEPTIONS
arm(64): move HAS_DMA and HAS_MODULES to CPU_32
arm(64): don't advertise stack_dumping capabilities for ARM64
arm: semihosting support is not implemented for ARM64
arm64: include correct setupc file in ARM64 PBL
arm64: drop unneeded files from Makefile
arm64: don't allow to build relocatable image
Michael Olbrich (1):
mci: mmci: Fix read FIFO handling
Philipp Zabel (3):
video: switch to media bus formats
video: add VPL ioctl to get bus format
video/edid: Fix edid_to_display_timings error path
Sam Van Den Berge (1):
Fix small typo in common/Kconfig
Sascha Hauer (27):
mtd: nand: define struct nand_timings
mtd: nand: add ONFI timing mode to nand_timings converter
mtd: nand-imx: split preset_v1_v2 into two functions
ARM: i.MX25: Provide a clock for the nand controller
mtd: nand-imx: Optimize timing for i.MX25
defaultenv-2: remove ps1 duplicates
defaultenv-2: remove unused *-menu-add-entry calls
usb: chipidea i.MX: Do not return unnecessary error
ARM: i.MX6 Santaro: Add enable-delay for the display
ARM: i.MX6 Santaro: Add USB support
ARM: i.MX6 Santaro: Add PBL console support
usb: i.MX chipidea: Enable VBUS regulator when needed
Merge branch 'for-next/defenv-2'
Merge branch 'for-next/imx'
Merge branch 'for-next/menu'
Merge branch 'for-next/mips'
Merge branch 'for-next/misc'
Merge branch 'for-next/rockchip'
Merge branch 'for-next/socfpga'
Merge branch 'for-next/video'
dts: update to v4.7-rc6
dts: update to v4.7
Merge branch 'for-next/dts'
ARM: karo-tx6: Include correct device tree
ARM: i.MX6: Enable parent propagation for clk_gate2
nv: Fix variable removal in nvvar_save()
Release v2016.10.0
Steffen Trumtrar (5):
filetype: add new filetype for SoCFPGA xload image
socfpga: remove dt entries that are upstream
ARM: socfpga: socrates: set alias for ethernet0
ARM: socfpga: socrates: add qspi partitions
ARM: socfpga: socrates: register bbu handlers
Trent Piepho (1):
socfpga: Add support for V1 images to socfpga_mkimage
Ulrich Ölmann (3):
ARM: socfpga: xload: support more qspi partitions
blspec: fix erroneus free in entry_is_of_compatible()
blspec: fix return value of entry_is_of_compatible()
Uwe Kleine-König (2):
ARM: imx6: reset PLL2's PFD2 on i.MX6D
net/phy: marvell: fix error handling
Wadim Egorov (8):
ARM: rockchip: Add basic RK3288 support
clocksource: Add rk3288 timer driver
ARM: rockchip: Add early debug support for RK3288
clk: Add RK3288 clock driver
mci: dw_mmc: Add RK3288 compatible string
ARM: Add phyCORE-RK3288 SOM support
configs: Add RK3288 defconfig
doc: Add RK3288 Documentation
grodriguez (1):
Call boot_board from boot, not from init.
--
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 4/5] Add filetype and detection for squashfs images
From: Yegor Yefremov @ 2016-10-07 12:08 UTC (permalink / raw)
To: Enrico Joerns; +Cc: barebox
In-Reply-To: <7945e859-d844-9c44-f776-87e35ffc27e3@pengutronix.de>
Hi Enrico,
On Thu, Oct 6, 2016 at 4:10 PM, Enrico Joerns <ejo@pengutronix.de> wrote:
> Hi Yegor,
>
> On 10/06/2016 03:55 PM, Yegor Yefremov wrote:
>>
>> On Tue, Oct 4, 2016 at 12:10 PM, Enrico Jorns <ejo@pengutronix.de> wrote:
>>>
>>> This adds `filetype_squashfs` to the list of known filetypes and adds a
>>> detection for squashfs files to file_detect_type(). This currently
>>> matches on the `hsqs` start sequence of an image file.
>>>
>>> Additionally, the newly introduced filetype is registered as the type of
>>> the squashfs_driver which allows, for example, to mount squashfs without
>>> the need to specify a type parameter.
>>>
>>> This changes enable booting a squashfs with the simple `boot` command
>>> pointing to the location (device) that holds the squashfs.
>>>
>>> Note that booting with blspec is limited as the current squashfs driver
>>> is not capable of handling symbolic links.
>>
>>
>> Glad to see SquashFS will be used not only by myself :-)
>
>
> glad to see that, too ;)
>
>> Could you explain how one can write a rootfs.sqaushfs to a ubiblock
>> from Linux and then what steps are needed in barebox?
>>
>> So far I've only found this info about ubiblock:
>> http://www.linux-mtd.infradead.org/doc/ubi.html#L_ubiblock, but it
>> doesn't say much.
>
>
> Yes, the informations provided are a bit sparse..
>
>> My actions were:
>>
>> ubiattach -p /dev/mtd5
>> ubiblock --create /dev/ubi0_0
>> ubiupdatevol /dev/ubi0_0 rootfs.squashfs
>>
>> Can I mount /dev/ubi0_0 via mount? If yes, what parameters I should use?
>
>
> The above commands look pretty similar to what I did. Mounting the ubiblock
> device does work too, with a little pitfall, mount will be confused by
> having a read-only file system but nobody told it before.
> So you must do
>
> mount -o ro /dev/ubiblock0_0 /mnt/test
>
>> How can I mount this volume in barebox step-by-step?
>
>
> Using it in barebox is pretty easy, as the ubiblock layer is not required
> there:
>
> ubiattach /dev/nand0.root
> ubiupdatevol /dev/nand0.root.ubi.ubivolname rootfs.squashfs
> mkdir /mnt/test
> mount /dev/nand0.root.ubi.ubivolname /mnt/test
>
>
> To boot via bootspec form a ubi containing a squashfs, you simply need to
>
> boot /dev/nand0.root.ubi.ubivolname
>
>
> Hope that helps.
Everything is working like a charm. I just had a problem with my
ccache and hence both my kernel and barebox got compiled without
squashfs support :-)
So here is my:
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Thanks.
Yegor
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: [PATCH 1/2] ARM: mvebu: add support for Netgear RN2120
From: Sascha Hauer @ 2016-10-07 9:07 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: barebox
In-Reply-To: <20161004191306.1838-1-u.kleine-koenig@pengutronix.de>
On Tue, Oct 04, 2016 at 09:13:05PM +0200, Uwe Kleine-König wrote:
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> arch/arm/boards/Makefile | 1 +
> arch/arm/boards/netgear-rn2120/Makefile | 2 +
> arch/arm/boards/netgear-rn2120/board.c | 88 +++++++++++++++++++++++++++++
> arch/arm/boards/netgear-rn2120/kwbimage.cfg | 7 +++
> arch/arm/boards/netgear-rn2120/lowlevel.c | 41 ++++++++++++++
> arch/arm/dts/Makefile | 1 +
> arch/arm/dts/armada-xp-rn2120-bb.dts | 11 ++++
> arch/arm/mach-mvebu/Kconfig | 4 ++
> images/Makefile.mvebu | 8 +++
> 9 files changed, 163 insertions(+)
> create mode 100644 arch/arm/boards/netgear-rn2120/Makefile
> create mode 100644 arch/arm/boards/netgear-rn2120/board.c
> create mode 100644 arch/arm/boards/netgear-rn2120/kwbimage.cfg
> create mode 100644 arch/arm/boards/netgear-rn2120/lowlevel.c
> create mode 100644 arch/arm/dts/armada-xp-rn2120-bb.dts
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] Add support for Baltos systems
From: Sascha Hauer @ 2016-10-07 8:16 UTC (permalink / raw)
To: yegorslists; +Cc: barebox
In-Reply-To: <1475751308-27894-1-git-send-email-yegorslists@googlemail.com>
On Thu, Oct 06, 2016 at 12:55:08PM +0200, yegorslists@googlemail.com wrote:
> From: Yegor Yefremov <yegorslists@googlemail.com>
>
> OnRISC Baltos devices are based on a am335x SoC and can be booted
> either from MMC or NAND.
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> Changes:
> v3: - make hw_param a local variable
> - implement memory size detection
> - remove baltos_mem_init initcall
> v2: - remove typedef
> - rework invalid EEPROM content handling
> - add mmc0 as boot device for MMC boot source
>
> arch/arm/boards/Makefile | 1 +
> arch/arm/boards/vscom-baltos/Makefile | 2 +
> arch/arm/boards/vscom-baltos/board.c | 132 ++++++++++
> arch/arm/boards/vscom-baltos/lowlevel.c | 134 ++++++++++
> arch/arm/dts/Makefile | 1 +
> arch/arm/dts/am335x-baltos-minimal.dts | 439 ++++++++++++++++++++++++++++++++
> arch/arm/mach-omap/Kconfig | 7 +
> images/Makefile.am33xx | 8 +
> 8 files changed, 724 insertions(+)
> create mode 100644 arch/arm/boards/vscom-baltos/Makefile
> create mode 100644 arch/arm/boards/vscom-baltos/board.c
> create mode 100644 arch/arm/boards/vscom-baltos/lowlevel.c
> create mode 100644 arch/arm/dts/am335x-baltos-minimal.dts
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 04/20] i.MX: Add support for VF610 Tower board
From: Sascha Hauer @ 2016-10-07 7:56 UTC (permalink / raw)
To: Andrey Smirnov; +Cc: barebox@lists.infradead.org
In-Reply-To: <CAHQ1cqFpyRK7EGq112s8+jGf=km15EobPQ3yR3HPK38QdCsQCw@mail.gmail.com>
On Tue, Oct 04, 2016 at 06:34:45AM -0700, Andrey Smirnov wrote:
> On Mon, Oct 3, 2016 at 11:32 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >> +static int vf610_twr_sdhc1_clock_init(void)
> >> +{
> >> + int err;
> >> + struct clk *esdhc1_div, *esdhc1_div_parent;
> >> +
> >> + if (!of_machine_is_compatible("fsl,vf610-twr"))
> >> + return 0;
> >> +
> >> + esdhc1_div = clk_lookup("esdhc1_div");
> >> +
> >> + if (IS_ERR(esdhc1_div))
> >> + return PTR_ERR(esdhc1_div);
> >> +
> >> + esdhc1_div_parent = clk_get_parent(esdhc1_div);
> >> + if (IS_ERR(esdhc1_div_parent))
> >> + return PTR_ERR(esdhc1_div_parent);
> >> +
> >> + err = clk_set_rate(esdhc1_div,
> >> + clk_get_rate(esdhc1_div_parent));
> >> + if (err)
> >> + return err;
> >> +
> >> + clk_put(esdhc1_div);
> >> +
> >> + return 0;
> >> +}
> >> +coredevice_initcall(vf610_twr_sdhc1_clock_init);
> >
> > What's the background for this? Should it be made SoC specific?
>
> The divider that peripheral bus clock is connected to before that
> clock goes to SDHC controller is not set to one, so if this is not set
> the parent clock ends up being something around 12Mhz.
This sounds like this should be done in the CCM init code as part of the
"bring the clocks to sane defaults", possibly for the other SDHC
controllers aswell.
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: why UBI static volumes are flagged as DEVFS_IS_CHARACTER_DEV
From: Sascha Hauer @ 2016-10-07 7:27 UTC (permalink / raw)
To: Teresa Remmet; +Cc: barebox, iw3gtf
In-Reply-To: <1475741847.3468.20.camel@lws-tremmet.phytec.de>
On Thu, Oct 06, 2016 at 10:17:27AM +0200, Teresa Remmet wrote:
> Hello Giorgio,
>
> Am Mittwoch, den 05.10.2016, 15:23 +0200 schrieb iw3gtf@arcor.de:
> > Hi,
> >
> > I noticed that the commit id c087e0804f0290e9886899e8a3cccb07c4ce088b flagged static
> > UBI volumes as DEVFS_IS_CHARACTER_DEV.
> >
> > A consequence of this flag is that commands like:
> >
> > # cp /dev/nand0.ubi_volumes.ubi.my_static_vol file
> >
> > will not work because the cp command will see a src file (the static UBI volume) with a size
> > of -1 (FILE_SIZE_STREAM) and keep on reading from the volume until a flood of
> > "UBI assert failed in ubi_eba_read_leb at 359" asserts comes out of the console.
> >
> > I tried to comment out the flag assignment, just to see what happen:
> >
> > int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
> > {
> > ...
> > cdev->size = vol->used_bytes;
> >
> > // if (vol->vol_type == UBI_STATIC_VOLUME)
> > // cdev->flags = DEVFS_IS_CHARACTER_DEV;
> >
> > cdev->dev = &vol->dev;
> > ...
> >
> > and then the cp command worked than as expected.
> >
> > Could someone shortly confirm that the DEVFS_IS_CHARACTER_DEV flag for static UBI volumes
> > is really needed (to avoid some other problems that my superficial test does not triggers) ?
>
> the size of a static ubi volume device is equal to the image size you
> flashed. When you create a new static ubi volume the size is 0, as it is
> empty.
> We need the chardev flag to be able to update the static ubi volume or
> barebox will complain that there is not enough space.
Then I think we need another solution for that. UBI volumes are clearly
not character devices, so we shouldn't set this flag to work around
other issues we have.
Currently devfs_truncate is implemented like:
static int devfs_truncate(struct device_d *dev, FILE *f, ulong size)
{
if (f->fsdev->dev.num_resources < 1)
return -ENOSPC;
if (size > resource_size(&f->fsdev->dev.resource[0]))
return -ENOSPC;
return 0;
}
Maybe we need an optional cdev->ops->truncate() to let the UBI volumes be
able to overwrite this behaviour?
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 1/2] Allow device parameters for devices with dots in name
From: Sascha Hauer @ 2016-10-07 7:09 UTC (permalink / raw)
To: Barebox List
Devices can have a dot in the name, so we can't expect to find the
full device name before the first dot. Currently parameters of devices
with a dot in the name are inaccessible from the shell.
Fix this by iterating over the possible device name / parameter name
combinations to find a existing combination.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/env.c | 48 ++++++++++++++++++++++++++++++++++--------------
1 file changed, 34 insertions(+), 14 deletions(-)
diff --git a/common/env.c b/common/env.c
index 6f736d5..df8a4df 100644
--- a/common/env.c
+++ b/common/env.c
@@ -135,26 +135,46 @@ static const char *getenv_raw(struct list_head *l, const char *name)
return NULL;
}
-const char *getenv (const char *name)
+static const char *dev_getenv(const char *name)
{
- struct env_context *c;
- const char *val;
+ const char *pos, *val, *dot, *varname;
+ char *devname;
+ struct device_d *dev;
+
+ pos = name;
+
+ while (1) {
+ dot = strchr(pos, '.');
+ if (!dot)
+ break;
+
+ devname = xstrndup(name, dot - name);
+ varname = dot + 1;
+
+ dev = get_device_by_name(devname);
+
+ free(devname);
- if (strchr(name, '.')) {
- const char *ret = NULL;
- char *devstr = strdup(name);
- char *par = strchr(devstr, '.');
- struct device_d *dev;
- *par = 0;
- dev = get_device_by_name(devstr);
if (dev) {
- par++;
- ret = dev_get_param(dev, par);
+ val = dev_get_param(dev, varname);
+ if (val)
+ return val;
}
- free(devstr);
- return ret;
+
+ pos = dot + 1;
}
+ return NULL;
+}
+
+const char *getenv(const char *name)
+{
+ struct env_context *c;
+ const char *val;
+
+ if (strchr(name, '.'))
+ return dev_getenv(name);
+
c = context;
val = getenv_raw(&c->local, name);
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* [PATCH 2/2] completion: Fix completion for devices with a dot in the name
From: Sascha Hauer @ 2016-10-07 7:09 UTC (permalink / raw)
To: Barebox List
In-Reply-To: <20161007070908.14855-1-s.hauer@pengutronix.de>
Devices can have a dot in the name, so do not expect the full
device name before the first dot.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/complete.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/common/complete.c b/common/complete.c
index aee21ea..2dab7d1 100644
--- a/common/complete.c
+++ b/common/complete.c
@@ -279,7 +279,7 @@ static int env_param_complete(struct string_list *sl, char *instr, int eval)
struct env_context *c;
char *instr_param;
int len;
- char end = '=';
+ char end = '=', *pos, *dot;
char *begin = "";
if (!instr)
@@ -290,7 +290,6 @@ static int env_param_complete(struct string_list *sl, char *instr, int eval)
end = ' ';
}
- instr_param = strchr(instr, '.');
len = strlen(instr);
c = get_current_context();
@@ -312,20 +311,21 @@ static int env_param_complete(struct string_list *sl, char *instr, int eval)
c = c->parent;
}
- if (instr_param) {
+ pos = instr;
+ while ((dot = strchr(pos, '.'))) {
char *devname;
- len = (instr_param - instr);
-
- devname = xstrndup(instr, len);
+ devname = xstrndup(instr, dot - instr);
instr_param++;
dev = get_device_by_name(devname);
free(devname);
+
if (dev)
- device_param_complete(dev, sl, instr_param, eval);
- return 0;
+ device_param_complete(dev, sl, dot + 1, eval);
+
+ pos = dot + 1;
}
len = strlen(instr);
--
2.9.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* Re: [PATCH 4/5] Add filetype and detection for squashfs images
From: Enrico Joerns @ 2016-10-06 14:10 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: barebox
In-Reply-To: <CAGm1_kvFujU0QcCdmREtbRfU7J_vQgMnJvs9k=dpR3PQ=9+_6g@mail.gmail.com>
Hi Yegor,
On 10/06/2016 03:55 PM, Yegor Yefremov wrote:
> On Tue, Oct 4, 2016 at 12:10 PM, Enrico Jorns <ejo@pengutronix.de> wrote:
>> This adds `filetype_squashfs` to the list of known filetypes and adds a
>> detection for squashfs files to file_detect_type(). This currently
>> matches on the `hsqs` start sequence of an image file.
>>
>> Additionally, the newly introduced filetype is registered as the type of
>> the squashfs_driver which allows, for example, to mount squashfs without
>> the need to specify a type parameter.
>>
>> This changes enable booting a squashfs with the simple `boot` command
>> pointing to the location (device) that holds the squashfs.
>>
>> Note that booting with blspec is limited as the current squashfs driver
>> is not capable of handling symbolic links.
>
> Glad to see SquashFS will be used not only by myself :-)
glad to see that, too ;)
> Could you explain how one can write a rootfs.sqaushfs to a ubiblock
> from Linux and then what steps are needed in barebox?
>
> So far I've only found this info about ubiblock:
> http://www.linux-mtd.infradead.org/doc/ubi.html#L_ubiblock, but it
> doesn't say much.
Yes, the informations provided are a bit sparse..
> My actions were:
>
> ubiattach -p /dev/mtd5
> ubiblock --create /dev/ubi0_0
> ubiupdatevol /dev/ubi0_0 rootfs.squashfs
>
> Can I mount /dev/ubi0_0 via mount? If yes, what parameters I should use?
The above commands look pretty similar to what I did. Mounting the
ubiblock device does work too, with a little pitfall, mount will be
confused by having a read-only file system but nobody told it before.
So you must do
mount -o ro /dev/ubiblock0_0 /mnt/test
> How can I mount this volume in barebox step-by-step?
Using it in barebox is pretty easy, as the ubiblock layer is not
required there:
ubiattach /dev/nand0.root
ubiupdatevol /dev/nand0.root.ubi.ubivolname rootfs.squashfs
mkdir /mnt/test
mount /dev/nand0.root.ubi.ubivolname /mnt/test
To boot via bootspec form a ubi containing a squashfs, you simply need to
boot /dev/nand0.root.ubi.ubivolname
Hope that helps.
Best regards, Enrico
--
Pengutronix e.K. | Enrico Jörns |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5080 |
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 4/5] Add filetype and detection for squashfs images
From: Yegor Yefremov @ 2016-10-06 13:55 UTC (permalink / raw)
To: Enrico Jorns; +Cc: barebox
In-Reply-To: <20161004101048.12970-5-ejo@pengutronix.de>
Hi Enrico,
On Tue, Oct 4, 2016 at 12:10 PM, Enrico Jorns <ejo@pengutronix.de> wrote:
> This adds `filetype_squashfs` to the list of known filetypes and adds a
> detection for squashfs files to file_detect_type(). This currently
> matches on the `hsqs` start sequence of an image file.
>
> Additionally, the newly introduced filetype is registered as the type of
> the squashfs_driver which allows, for example, to mount squashfs without
> the need to specify a type parameter.
>
> This changes enable booting a squashfs with the simple `boot` command
> pointing to the location (device) that holds the squashfs.
>
> Note that booting with blspec is limited as the current squashfs driver
> is not capable of handling symbolic links.
Glad to see SquashFS will be used not only by myself :-)
Could you explain how one can write a rootfs.sqaushfs to a ubiblock
from Linux and then what steps are needed in barebox?
So far I've only found this info about ubiblock:
http://www.linux-mtd.infradead.org/doc/ubi.html#L_ubiblock, but it
doesn't say much.
My actions were:
ubiattach -p /dev/mtd5
ubiblock --create /dev/ubi0_0
ubiupdatevol /dev/ubi0_0 rootfs.squashfs
Can I mount /dev/ubi0_0 via mount? If yes, what parameters I should use?
How can I mount this volume in barebox step-by-step?
Thanks.
Yegor
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
> ---
> common/filetype.c | 4 ++++
> fs/squashfs/squashfs.c | 1 +
> include/filetype.h | 1 +
> 3 files changed, 6 insertions(+)
>
> diff --git a/common/filetype.c b/common/filetype.c
> index 4728f87..8d72933 100644
> --- a/common/filetype.c
> +++ b/common/filetype.c
> @@ -40,6 +40,7 @@ static const struct filetype_str filetype_str[] = {
> [filetype_uimage] = { "U-Boot uImage", "u-boot" },
> [filetype_ubi] = { "UBI image", "ubi" },
> [filetype_jffs2] = { "JFFS2 image", "jffs2" },
> + [filetype_squashfs] = { "Squashfs image", "squashfs" },
> [filetype_gzip] = { "GZIP compressed", "gzip" },
> [filetype_bzip2] = { "BZIP2 compressed", "bzip2" },
> [filetype_oftree] = { "open firmware Device Tree flattened Binary", "dtb" },
> @@ -278,6 +279,9 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
> if (buf8[0] == 0xfd && buf8[1] == 0x37 && buf8[2] == 0x7a &&
> buf8[3] == 0x58 && buf8[4] == 0x5a && buf8[5] == 0x00)
> return filetype_xz_compressed;
> + if (buf8[0] == 'h' && buf8[1] == 's' && buf8[2] == 'q' &&
> + buf8[3] == 's')
> + return filetype_squashfs;
> if (buf[0] == be32_to_cpu(0xd00dfeed))
> return filetype_oftree;
> if (strncmp(buf8, "ANDROID!", 8) == 0)
> diff --git a/fs/squashfs/squashfs.c b/fs/squashfs/squashfs.c
> index d00dee6..6d04681 100644
> --- a/fs/squashfs/squashfs.c
> +++ b/fs/squashfs/squashfs.c
> @@ -353,6 +353,7 @@ static struct fs_driver_d squashfs_driver = {
> .readdir = squashfs_readdir,
> .closedir = squashfs_closedir,
> .stat = squashfs_stat,
> + .type = filetype_squashfs,
> .drv = {
> .probe = squashfs_probe,
> .remove = squashfs_remove,
> diff --git a/include/filetype.h b/include/filetype.h
> index cde73c1..65bd6ef 100644
> --- a/include/filetype.h
> +++ b/include/filetype.h
> @@ -16,6 +16,7 @@ enum filetype {
> filetype_uimage,
> filetype_ubi,
> filetype_jffs2,
> + filetype_squashfs,
> filetype_gzip,
> filetype_bzip2,
> filetype_oftree,
> --
> 2.9.3
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: am335x: memory configuration
From: Yegor Yefremov @ 2016-10-06 13:50 UTC (permalink / raw)
To: Jan Remmet; +Cc: barebox
In-Reply-To: <57f65594.d4491c0a.37103.324dSMTPIN_ADDED_BROKEN@mx.google.com>
Hi Jan,
On Thu, Oct 6, 2016 at 3:45 PM, Jan Remmet <J.Remmet@phytec.de> wrote:
> On Thu, Oct 06, 2016 at 11:08:07AM +0200, Yegor Yefremov wrote:
>> I've submitted a patch [1] to support our Baltos systems back in the
>> May. There was an issue with dynamically detecting RAM size as the
>> systems can have either 256MB or 512MB modules.
>>
>> So far u-boot was able to detect the RAM size dynamically. In order to
>> do so it uses following code in arch/arm/cpu/armv7/am33xx/emif4.c:
>>
>> int dram_init(void)
>> {
>>
>> #ifndef CONFIG_SKIP_LOWLEVEL_INIT
>> sdram_init();
>> #endif
>>
>> /* dram_init must store complete ramsize in gd->ram_size */
>> gd->ram_size = get_ram_size(
>> (void *)CONFIG_SYS_SDRAM_BASE,
>> CONFIG_MAX_RAM_BANK_SIZE);
>> return 0;
>> }
>>
>> void dram_init_banksize(void)
>> {
>> gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
>> gd->bd->bi_dram[0].size = gd->ram_size;
>> }
>>
>> This peace of code will be excuted in u-boot.img (not in MLO).
>>
>> In Barebox we have get_ram_size(), that provides real RAM size and
>> am335x_sdram_size(), that returns RAM controller settings. So far DDR
>> controler will be configured for 512MB regardless of the module. Hence
>> the return value from am335x_sdram_size() cannot be used for crating
>> ram0 node.
> On our am335x boards we use MLOs with individual RAM timings and EMIF config
> values. So am335x_sdram_size works fine in barebox.bin.
> Maybe get_ram_size works if the timing settings are equal?
I've solved the problem the way Sascha proposed earlier (see the third
version of my patch sent today).
In MLO I setup memory controller to 512MB, then I check the real
amount via get_ram_size() and if I have 256MB I just reinitialize the
memory controller with values for 256Mb i.e. rows 14 instead of 15.
With this done one can use am335x_sdram_size() in other parts of
berebox.
Thanks for the feedback.
Yegor
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: am335x: memory configuration
From: Jan Remmet @ 2016-10-06 13:45 UTC (permalink / raw)
To: Yegor Yefremov; +Cc: barebox
In-Reply-To: <CAGm1_ku0Vh=SC0omVMUZof3DBJhvFRPsgxg1BDEn4GGTpez9_g@mail.gmail.com>
On Thu, Oct 06, 2016 at 11:08:07AM +0200, Yegor Yefremov wrote:
> I've submitted a patch [1] to support our Baltos systems back in the
> May. There was an issue with dynamically detecting RAM size as the
> systems can have either 256MB or 512MB modules.
>
> So far u-boot was able to detect the RAM size dynamically. In order to
> do so it uses following code in arch/arm/cpu/armv7/am33xx/emif4.c:
>
> int dram_init(void)
> {
>
> #ifndef CONFIG_SKIP_LOWLEVEL_INIT
> sdram_init();
> #endif
>
> /* dram_init must store complete ramsize in gd->ram_size */
> gd->ram_size = get_ram_size(
> (void *)CONFIG_SYS_SDRAM_BASE,
> CONFIG_MAX_RAM_BANK_SIZE);
> return 0;
> }
>
> void dram_init_banksize(void)
> {
> gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
> gd->bd->bi_dram[0].size = gd->ram_size;
> }
>
> This peace of code will be excuted in u-boot.img (not in MLO).
>
> In Barebox we have get_ram_size(), that provides real RAM size and
> am335x_sdram_size(), that returns RAM controller settings. So far DDR
> controler will be configured for 512MB regardless of the module. Hence
> the return value from am335x_sdram_size() cannot be used for crating
> ram0 node.
On our am335x boards we use MLOs with individual RAM timings and EMIF config
values. So am335x_sdram_size works fine in barebox.bin.
Maybe get_ram_size works if the timing settings are equal?
Jan
>
> What were the best way to provide get_ram_size() from lowlevel.c to
> board.c, where I would invoke:
> arm_add_mem_device("ram0", 0x80000000, sdram_size);
>
> [1] http://lists.infradead.org/pipermail/barebox/2016-May/027224.html
>
> Yegor
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* [PATCH v3] Add support for Baltos systems
From: yegorslists @ 2016-10-06 10:55 UTC (permalink / raw)
To: barebox
From: Yegor Yefremov <yegorslists@googlemail.com>
OnRISC Baltos devices are based on a am335x SoC and can be booted
either from MMC or NAND.
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
Changes:
v3: - make hw_param a local variable
- implement memory size detection
- remove baltos_mem_init initcall
v2: - remove typedef
- rework invalid EEPROM content handling
- add mmc0 as boot device for MMC boot source
arch/arm/boards/Makefile | 1 +
arch/arm/boards/vscom-baltos/Makefile | 2 +
arch/arm/boards/vscom-baltos/board.c | 132 ++++++++++
arch/arm/boards/vscom-baltos/lowlevel.c | 134 ++++++++++
arch/arm/dts/Makefile | 1 +
arch/arm/dts/am335x-baltos-minimal.dts | 439 ++++++++++++++++++++++++++++++++
arch/arm/mach-omap/Kconfig | 7 +
images/Makefile.am33xx | 8 +
8 files changed, 724 insertions(+)
create mode 100644 arch/arm/boards/vscom-baltos/Makefile
create mode 100644 arch/arm/boards/vscom-baltos/board.c
create mode 100644 arch/arm/boards/vscom-baltos/lowlevel.c
create mode 100644 arch/arm/dts/am335x-baltos-minimal.dts
diff --git a/arch/arm/boards/Makefile b/arch/arm/boards/Makefile
index 23a8dbd..da6ea0d 100644
--- a/arch/arm/boards/Makefile
+++ b/arch/arm/boards/Makefile
@@ -137,4 +137,5 @@ obj-$(CONFIG_MACH_VIRT2REAL) += virt2real/
obj-$(CONFIG_MACH_ZEDBOARD) += avnet-zedboard/
obj-$(CONFIG_MACH_ZYLONITE) += zylonite/
obj-$(CONFIG_MACH_VARISCITE_MX6) += variscite-mx6/
+obj-$(CONFIG_MACH_VSCOM_BALTOS) += vscom-baltos/
obj-$(CONFIG_MACH_QEMU_VIRT64) += qemu-virt64/
diff --git a/arch/arm/boards/vscom-baltos/Makefile b/arch/arm/boards/vscom-baltos/Makefile
new file mode 100644
index 0000000..092c31d
--- /dev/null
+++ b/arch/arm/boards/vscom-baltos/Makefile
@@ -0,0 +1,2 @@
+lwl-y += lowlevel.o
+obj-y += board.o
diff --git a/arch/arm/boards/vscom-baltos/board.c b/arch/arm/boards/vscom-baltos/board.c
new file mode 100644
index 0000000..dc08ed5
--- /dev/null
+++ b/arch/arm/boards/vscom-baltos/board.c
@@ -0,0 +1,132 @@
+/*
+ * (C) Copyright 2008
+ * Texas Instruments, <www.ti.com>
+ * Raghavendra KH <r-khandenahally@ti.com>
+ *
+ * Copyright (C) 2012 Jan Luebbe <j.luebbe@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/**
+ * @file
+ * @brief OnRISC Baltos Specific Board Initialization routines
+ */
+
+#include <common.h>
+#include <init.h>
+#include <driver.h>
+#include <envfs.h>
+#include <environment.h>
+#include <globalvar.h>
+#include <linux/sizes.h>
+#include <net.h>
+#include <envfs.h>
+#include <bootsource.h>
+#include <asm/armlinux.h>
+#include <generated/mach-types.h>
+#include <mach/am33xx-generic.h>
+#include <mach/am33xx-silicon.h>
+#include <mach/sys_info.h>
+#include <mach/syslib.h>
+#include <mach/gpmc.h>
+#include <linux/err.h>
+#include <mach/bbu.h>
+#include <libfile.h>
+
+static struct omap_barebox_part baltos_barebox_part = {
+ .nand_offset = SZ_512K,
+ .nand_size = 0x1e0000,
+};
+
+struct bsp_vs_hwparam {
+ uint32_t Magic;
+ uint32_t HwRev;
+ uint32_t SerialNumber;
+ char PrdDate[11];
+ uint16_t SystemId;
+ uint8_t MAC1[6];
+ uint8_t MAC2[6];
+ uint8_t MAC3[6];
+} __attribute__ ((packed));
+
+static int baltos_read_eeprom(void)
+{
+ struct bsp_vs_hwparam hw_param;
+ size_t size;
+ char *buf, var_buf[32];
+ int rc;
+ unsigned char mac_addr[6];
+
+ rc = read_file_2("/dev/eeprom0",
+ &size,
+ (void *)&buf,
+ sizeof(hw_param));
+ if (rc && rc != -EFBIG)
+ return rc;
+
+ memcpy(&hw_param, buf, sizeof(hw_param));
+
+ free(buf);
+
+ if (hw_param.Magic == 0xDEADBEEF) {
+ /* setup MAC1 */
+ mac_addr[0] = hw_param.MAC1[0];
+ mac_addr[1] = hw_param.MAC1[1];
+ mac_addr[2] = hw_param.MAC1[2];
+ mac_addr[3] = hw_param.MAC1[3];
+ mac_addr[4] = hw_param.MAC1[4];
+ mac_addr[5] = hw_param.MAC1[5];
+
+ eth_register_ethaddr(0, mac_addr);
+
+ /* setup MAC2 */
+ mac_addr[0] = hw_param.MAC2[0];
+ mac_addr[1] = hw_param.MAC2[1];
+ mac_addr[2] = hw_param.MAC2[2];
+ mac_addr[3] = hw_param.MAC2[3];
+ mac_addr[4] = hw_param.MAC2[4];
+ mac_addr[5] = hw_param.MAC2[5];
+
+ eth_register_ethaddr(1, mac_addr);
+ } else {
+ printf("Baltos: incorrect magic number (0x%x) "
+ "in EEPROM\n",
+ hw_param.Magic);
+
+ hw_param.SystemId = 0;
+ }
+
+ sprintf(var_buf, "%d", hw_param.SystemId);
+ globalvar_add_simple("board.id", var_buf);
+
+ return 0;
+}
+environment_initcall(baltos_read_eeprom);
+
+static int baltos_devices_init(void)
+{
+ if (!of_machine_is_compatible("vscom,onrisc"))
+ return 0;
+
+ globalvar_add_simple("board.variant", "baltos");
+
+ if (bootsource_get() == BOOTSOURCE_MMC)
+ omap_set_bootmmc_devname("mmc0");
+
+ omap_set_barebox_part(&baltos_barebox_part);
+
+ if (IS_ENABLED(CONFIG_SHELL_NONE))
+ return am33xx_of_register_bootdevice();
+
+ return 0;
+}
+coredevice_initcall(baltos_devices_init);
diff --git a/arch/arm/boards/vscom-baltos/lowlevel.c b/arch/arm/boards/vscom-baltos/lowlevel.c
new file mode 100644
index 0000000..8bce91a
--- /dev/null
+++ b/arch/arm/boards/vscom-baltos/lowlevel.c
@@ -0,0 +1,134 @@
+#include <common.h>
+#include <init.h>
+#include <linux/sizes.h>
+#include <io.h>
+#include <linux/string.h>
+#include <debug_ll.h>
+#include <asm/barebox-arm-head.h>
+#include <asm/barebox-arm.h>
+#include <mach/am33xx-silicon.h>
+#include <mach/am33xx-clock.h>
+#include <mach/generic.h>
+#include <mach/sdrc.h>
+#include <mach/sys_info.h>
+#include <mach/syslib.h>
+#include <mach/am33xx-mux.h>
+#include <mach/am33xx-generic.h>
+#include <mach/wdt.h>
+
+static const struct am33xx_ddr_data ddr3_data = {
+ .rd_slave_ratio0 = 0x38,
+ .wr_dqs_slave_ratio0 = 0x44,
+ .fifo_we_slave_ratio0 = 0x94,
+ .wr_slave_ratio0 = 0x7D,
+ .use_rank0_delay = 0x01,
+ .dll_lock_diff0 = 0x0,
+};
+
+static const struct am33xx_cmd_control ddr3_cmd_ctrl = {
+ .slave_ratio0 = 0x80,
+ .dll_lock_diff0 = 0x1,
+ .invert_clkout0 = 0x0,
+ .slave_ratio1 = 0x80,
+ .dll_lock_diff1 = 0x1,
+ .invert_clkout1 = 0x0,
+ .slave_ratio2 = 0x80,
+ .dll_lock_diff2 = 0x1,
+ .invert_clkout2 = 0x0,
+};
+
+static const struct am33xx_emif_regs ddr3_regs = {
+ .emif_read_latency = 0x100007,
+ .emif_tim1 = 0x0AAAD4DB,
+ .emif_tim2 = 0x266B7FDA,
+ .emif_tim3 = 0x501F867F,
+ .zq_config = 0x50074BE4,
+ .sdram_config = 0x61C05332,
+ .sdram_config2 = 0x0,
+ .sdram_ref_ctrl = 0xC30,
+};
+
+static const struct am33xx_ddr_data ddr3_data_256mb = {
+ .rd_slave_ratio0 = 0x36,
+ .wr_dqs_slave_ratio0 = 0x38,
+ .fifo_we_slave_ratio0 = 0x99,
+ .wr_slave_ratio0 = 0x73,
+};
+
+static const struct am33xx_emif_regs ddr3_regs_256mb = {
+ .emif_read_latency = 0x7,
+ .emif_tim1 = 0x0AAAD4DB,
+ .emif_tim2 = 0x26437FDA,
+ .emif_tim3 = 0x501F83FF,
+ .sdram_config = 0x61C052B2,
+ .zq_config = 0x50074BE4,
+ .sdram_ref_ctrl = 0x00000C30,
+
+};
+
+extern char __dtb_am335x_baltos_minimal_start[];
+
+/**
+ * @brief The basic entry point for board initialization.
+ *
+ * This is called as part of machine init (after arch init).
+ * This is again called with stack in SRAM, so not too many
+ * constructs possible here.
+ *
+ * @return void
+ */
+static noinline int baltos_sram_init(void)
+{
+ uint32_t sdram_size;
+ void *fdt;
+
+ fdt = __dtb_am335x_baltos_minimal_start;
+
+ /* WDT1 is already running when the bootloader gets control
+ * Disable it to avoid "random" resets
+ */
+ __raw_writel(WDT_DISABLE_CODE1, AM33XX_WDT_REG(WSPR));
+ while (__raw_readl(AM33XX_WDT_REG(WWPS)) != 0x0);
+ __raw_writel(WDT_DISABLE_CODE2, AM33XX_WDT_REG(WSPR));
+ 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);
+ 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)
+ am335x_sdram_init(0x18B, &ddr3_cmd_ctrl, &ddr3_regs_256mb,
+ &ddr3_data_256mb);
+
+ am33xx_uart_soft_reset((void *)AM33XX_UART0_BASE);
+ am33xx_enable_uart0_pin_mux();
+ omap_uart_lowlevel_init((void *)AM33XX_UART0_BASE);
+ putc_ll('>');
+
+ am335x_barebox_entry(fdt);
+}
+
+ENTRY_FUNCTION(start_am33xx_baltos_sram, bootinfo, r1, r2)
+{
+ am33xx_save_bootinfo((void *)bootinfo);
+
+ /*
+ * Setup C environment, the board init code uses global variables.
+ * Stackpointer has already been initialized by the ROM code.
+ */
+ relocate_to_current_adr();
+ setup_c();
+
+ baltos_sram_init();
+}
+
+ENTRY_FUNCTION(start_am33xx_baltos_sdram, r0, r1, r2)
+{
+ void *fdt;
+
+ fdt = __dtb_am335x_baltos_minimal_start;
+
+ fdt -= get_runtime_offset();
+
+ am335x_barebox_entry(fdt);
+}
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index d1a3fe8..765cd59 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -76,5 +76,6 @@ pbl-dtb-$(CONFIG_MACH_TX6X) += imx6q-tx6q.dtb.o
pbl-dtb-$(CONFIG_MACH_UDOO) += imx6q-udoo.dtb.o
pbl-dtb-$(CONFIG_MACH_USI_TOPKICK) += kirkwood-topkick-bb.dtb.o
pbl-dtb-$(CONFIG_MACH_VARISCITE_MX6) += imx6q-var-custom.dtb.o
+pbl-dtb-$(CONFIG_MACH_VSCOM_BALTOS) += am335x-baltos-minimal.dtb.o
clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts *.dtb.lzo
diff --git a/arch/arm/dts/am335x-baltos-minimal.dts b/arch/arm/dts/am335x-baltos-minimal.dts
new file mode 100644
index 0000000..13eb91c
--- /dev/null
+++ b/arch/arm/dts/am335x-baltos-minimal.dts
@@ -0,0 +1,439 @@
+/*
+ * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * 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.
+ */
+
+/*
+ * VScom OnRISC
+ * http://www.vscom.de
+ */
+
+/dts-v1/;
+
+#include "am33xx.dtsi"
+#include <dt-bindings/pwm/pwm.h>
+
+/ {
+ model = "OnRISC Baltos";
+ compatible = "vscom,onrisc", "ti,am33xx";
+
+ chosen {
+ linux,stdout-path = &uart0;
+ };
+
+ cpus {
+ cpu@0 {
+ cpu0-supply = <&vdd1_reg>;
+ };
+ };
+
+ vbat: fixedregulator@0 {
+ compatible = "regulator-fixed";
+ regulator-name = "vbat";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ };
+};
+
+&am33xx_pinmux {
+ mmc1_pins: pinmux_mmc1_pins {
+ pinctrl-single,pins = <
+ 0xf0 (MUX_MODE0 | INPUT_EN | PULL_UP) /* mmc0_dat3.mmc0_dat3 */
+ 0xf4 (MUX_MODE0 | INPUT_EN | PULL_UP) /* mmc0_dat2.mmc0_dat2 */
+ 0xf8 (MUX_MODE0 | INPUT_EN | PULL_UP) /* mmc0_dat1.mmc0_dat1 */
+ 0xfc (MUX_MODE0 | INPUT_EN | PULL_UP) /* mmc0_dat0.mmc0_dat0 */
+ 0x100 (MUX_MODE0 | INPUT_EN | PULL_UP) /* mmc0_clk.mmc0_clk */
+ 0x104 (MUX_MODE0 | INPUT_EN | PULL_UP) /* mmc0_cmd.mmc0_cmd */
+ >;
+ };
+
+ i2c1_pins: pinmux_i2c1_pins {
+ pinctrl-single,pins = <
+ 0x158 0x2a /* spi0_d1.i2c1_sda_mux3, INPUT | MODE2 */
+ 0x15c 0x2a /* spi0_cs0.i2c1_scl_mux3, INPUT | MODE2 */
+ >;
+ };
+
+ tps65910_pins: pinmux_tps65910_pins {
+ pinctrl-single,pins = <
+ 0x078 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_ben1.gpio1[28] */
+ >;
+
+ };
+ tca6416_pins: pinmux_tca6416_pins {
+ pinctrl-single,pins = <
+ AM33XX_IOPAD(0x9b4, PIN_INPUT_PULLUP | MUX_MODE7) /* xdma_event_intr1.gpio0[20] tca6416 stuff */
+ >;
+ };
+
+ uart0_pins: pinmux_uart0_pins {
+ pinctrl-single,pins = <
+ 0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */
+ 0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart0_txd.uart0_txd */
+ >;
+ };
+
+ cpsw_default: cpsw_default {
+ pinctrl-single,pins = <
+ /* Slave 1 */
+ 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_crs.rmii1_crs_dv */
+ 0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_tx_en.rmii1_txen */
+ 0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd1.rmii1_txd1 */
+ 0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_txd0.rmii1_txd0 */
+ 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd1.rmii1_rxd1 */
+ 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE1) /* mii1_rxd0.rmii1_rxd0 */
+ 0x144 (PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii1_ref_clk.rmii1_refclk */
+
+
+ /* Slave 2 */
+ 0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a0.rgmii2_tctl */
+ 0x44 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a1.rgmii2_rctl */
+ 0x48 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a2.rgmii2_td3 */
+ 0x4c (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a3.rgmii2_td2 */
+ 0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a4.rgmii2_td1 */
+ 0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a5.rgmii2_td0 */
+ 0x58 (PIN_OUTPUT_PULLDOWN | MUX_MODE2) /* gpmc_a6.rgmii2_tclk */
+ 0x5c (PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a7.rgmii2_rclk */
+ 0x60 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a8.rgmii2_rd3 */
+ 0x64 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a9.rgmii2_rd2 */
+ 0x68 (PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a10.rgmii2_rd1 */
+ 0x6c (PIN_INPUT_PULLDOWN | MUX_MODE2) /* gpmc_a11.rgmii2_rd0 */
+ >;
+ };
+
+ cpsw_sleep: cpsw_sleep {
+ pinctrl-single,pins = <
+ /* Slave 1 reset value */
+ 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x144 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+
+ /* Slave 2 reset value*/
+ 0x40 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x44 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x48 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x4c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x50 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x54 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x58 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x5c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x60 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x68 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x6c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ >;
+ };
+
+ davinci_mdio_default: davinci_mdio_default {
+ pinctrl-single,pins = <
+ /* MDIO */
+ 0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0) /* mdio_data.mdio_data */
+ 0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0) /* mdio_clk.mdio_clk */
+ >;
+ };
+
+ davinci_mdio_sleep: davinci_mdio_sleep {
+ pinctrl-single,pins = <
+ /* MDIO reset value */
+ 0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ 0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
+ >;
+ };
+
+ nandflash_pins_s0: nandflash_pins_s0 {
+ pinctrl-single,pins = <
+ 0x0 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */
+ 0x4 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad1.gpmc_ad1 */
+ 0x8 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad2.gpmc_ad2 */
+ 0xc (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad3.gpmc_ad3 */
+ 0x10 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad4.gpmc_ad4 */
+ 0x14 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad5.gpmc_ad5 */
+ 0x18 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad6.gpmc_ad6 */
+ 0x1c (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_ad7.gpmc_ad7 */
+ 0x70 (PIN_INPUT_PULLUP | MUX_MODE0) /* gpmc_wait0.gpmc_wait0 */
+ 0x74 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_wpn.gpio0_30 */
+ 0x7c (PIN_OUTPUT | MUX_MODE0) /* gpmc_csn0.gpmc_csn0 */
+ 0x90 (PIN_OUTPUT | MUX_MODE0) /* gpmc_advn_ale.gpmc_advn_ale */
+ 0x94 (PIN_OUTPUT | MUX_MODE0) /* gpmc_oen_ren.gpmc_oen_ren */
+ 0x98 (PIN_OUTPUT | MUX_MODE0) /* gpmc_wen.gpmc_wen */
+ 0x9c (PIN_OUTPUT | MUX_MODE0) /* gpmc_be0n_cle.gpmc_be0n_cle */
+ >;
+ };
+};
+
+&elm {
+ status = "okay";
+};
+
+&gpmc {
+ pinctrl-names = "default";
+ pinctrl-0 = <&nandflash_pins_s0>;
+ ranges = <0 0 0x08000000 0x10000000>; /* CS0: NAND */
+ status = "okay";
+
+ nand@0,0 {
+ reg = <0 0 0>; /* CS0, offset 0 */
+ nand-bus-width = <8>;
+ ti,nand-ecc-opt = "bch8";
+ ti,nand-xfer-type = "polled";
+
+ gpmc,device-nand = "true";
+ gpmc,device-width = <1>;
+ gpmc,sync-clk-ps = <0>;
+ gpmc,cs-on-ns = <0>;
+ gpmc,cs-rd-off-ns = <44>;
+ gpmc,cs-wr-off-ns = <44>;
+ gpmc,adv-on-ns = <6>;
+ gpmc,adv-rd-off-ns = <34>;
+ gpmc,adv-wr-off-ns = <44>;
+ gpmc,we-on-ns = <0>;
+ gpmc,we-off-ns = <40>;
+ gpmc,oe-on-ns = <0>;
+ gpmc,oe-off-ns = <54>;
+ gpmc,access-ns = <64>;
+ gpmc,rd-cycle-ns = <82>;
+ gpmc,wr-cycle-ns = <82>;
+ gpmc,wait-on-read = "true";
+ gpmc,wait-on-write = "true";
+ gpmc,bus-turnaround-ns = <0>;
+ gpmc,cycle2cycle-delay-ns = <0>;
+ gpmc,clk-activation-ns = <0>;
+ gpmc,wait-monitoring-ns = <0>;
+ gpmc,wr-access-ns = <40>;
+ gpmc,wr-data-mux-bus-ns = <0>;
+
+ #address-cells = <1>;
+ #size-cells = <1>;
+ elm_id = <&elm>;
+
+ boot@0 {
+ label = "SPL";
+ reg = <0x0 0x20000>;
+ };
+ boot@20000{
+ label = "SPL.backup1";
+ reg = <0x20000 0x20000>;
+ };
+ boot@40000 {
+ label = "SPL.backup2";
+ reg = <0x40000 0x20000>;
+ };
+ boot@60000 {
+ label = "SPL.backup3";
+ reg = <0x60000 0x20000>;
+ };
+ boot@80000 {
+ label = "u-boot";
+ reg = <0x80000 0x1e0000>;
+ };
+ boot@260000 {
+ label = "UBI";
+ reg = <0x260000 0xfda0000>;
+ };
+ };
+};
+
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_pins>;
+
+ status = "okay";
+};
+
+&i2c1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins>;
+
+ status = "okay";
+ clock-frequency = <1000>;
+
+ tps: tps@2d {
+ reg = <0x2d>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-parent = <&gpio1>;
+ interrupts = <28 GPIO_ACTIVE_LOW>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&tps65910_pins>;
+ };
+
+ at24@50 {
+ compatible = "at24,24c02";
+ pagesize = <8>;
+ reg = <0x50>;
+ };
+
+ tca6416: gpio@20 {
+ compatible = "ti,tca6416";
+ reg = <0x20>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <20 GPIO_ACTIVE_LOW>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&tca6416_pins>;
+ };
+};
+
+&usb {
+ status = "okay";
+};
+
+&usb_ctrl_mod {
+ status = "okay";
+};
+
+&usb0_phy {
+ status = "okay";
+};
+
+&usb1_phy {
+ status = "okay";
+};
+
+&usb0 {
+ status = "okay";
+ dr_mode = "host";
+};
+
+&usb1 {
+ status = "okay";
+ dr_mode = "host";
+};
+
+&cppi41dma {
+ status = "okay";
+};
+
+/include/ "tps65910.dtsi"
+
+&tps {
+ vcc1-supply = <&vbat>;
+ vcc2-supply = <&vbat>;
+ vcc3-supply = <&vbat>;
+ vcc4-supply = <&vbat>;
+ vcc5-supply = <&vbat>;
+ vcc6-supply = <&vbat>;
+ vcc7-supply = <&vbat>;
+ vccio-supply = <&vbat>;
+
+ ti,en-ck32k-xtal = <1>;
+
+ regulators {
+ vrtc_reg: regulator@0 {
+ regulator-always-on;
+ };
+
+ vio_reg: regulator@1 {
+ regulator-always-on;
+ };
+
+ vdd1_reg: regulator@2 {
+ /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
+ regulator-name = "vdd_mpu";
+ regulator-min-microvolt = <912500>;
+ regulator-max-microvolt = <1312500>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vdd2_reg: regulator@3 {
+ /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
+ regulator-name = "vdd_core";
+ regulator-min-microvolt = <912500>;
+ regulator-max-microvolt = <1150000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vdd3_reg: regulator@4 {
+ regulator-always-on;
+ };
+
+ vdig1_reg: regulator@5 {
+ regulator-always-on;
+ };
+
+ vdig2_reg: regulator@6 {
+ regulator-always-on;
+ };
+
+ vpll_reg: regulator@7 {
+ regulator-always-on;
+ };
+
+ vdac_reg: regulator@8 {
+ regulator-always-on;
+ };
+
+ vaux1_reg: regulator@9 {
+ regulator-always-on;
+ };
+
+ vaux2_reg: regulator@10 {
+ regulator-always-on;
+ };
+
+ vaux33_reg: regulator@11 {
+ regulator-always-on;
+ };
+
+ vmmc_reg: regulator@12 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+ };
+};
+
+&mac {
+ pinctrl-names = "default", "sleep";
+ pinctrl-0 = <&cpsw_default>;
+ pinctrl-1 = <&cpsw_sleep>;
+ dual_emac = <1>;
+
+ status = "okay";
+};
+
+&davinci_mdio {
+ pinctrl-names = "default", "sleep";
+ pinctrl-0 = <&davinci_mdio_default>;
+ pinctrl-1 = <&davinci_mdio_sleep>;
+
+ status = "okay";
+};
+
+&cpsw_emac0 {
+ phy_id = <&davinci_mdio>, <0>;
+ phy-mode = "rmii";
+ dual_emac_res_vlan = <1>;
+};
+
+&cpsw_emac1 {
+ phy_id = <&davinci_mdio>, <7>;
+ phy-mode = "rgmii-txid";
+ dual_emac_res_vlan = <2>;
+};
+
+&phy_sel {
+ rmii-clock-ext = <1>;
+};
+
+&mmc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc1_pins>;
+ vmmc-supply = <&vmmc_reg>;
+ status = "okay";
+};
+
+&gpio0 {
+ ti,no-reset-on-init;
+};
diff --git a/arch/arm/mach-omap/Kconfig b/arch/arm/mach-omap/Kconfig
index d7c863c..a1bb8f0 100644
--- a/arch/arm/mach-omap/Kconfig
+++ b/arch/arm/mach-omap/Kconfig
@@ -184,6 +184,13 @@ config MACH_PHYTEC_SOM_AM335X
select ARCH_AM33XX
help
Say Y here if you are using a am335x based Phytecs SOM
+
+config MACH_VSCOM_BALTOS
+ bool "VScom Baltos Devices"
+ select ARCH_AM33XX
+ help
+ Say Y here if you are using a am335x based VScom Baltos devices
+
endif
choice
diff --git a/images/Makefile.am33xx b/images/Makefile.am33xx
index 8be78ef..8168fe4 100644
--- a/images/Makefile.am33xx
+++ b/images/Makefile.am33xx
@@ -135,6 +135,14 @@ pblx-$(CONFIG_MACH_BEAGLEBONE) += start_am33xx_beaglebone_sram
FILE_barebox-am33xx-beaglebone-mlo.img = start_am33xx_beaglebone_sram.pblx.mlo
am33xx-mlo-$(CONFIG_MACH_BEAGLEBONE) += barebox-am33xx-beaglebone-mlo.img
+pblx-$(CONFIG_MACH_VSCOM_BALTOS) += start_am33xx_baltos_sdram
+FILE_barebox-am33xx-baltos.img = start_am33xx_baltos_sdram.pblx
+am33xx-barebox-$(CONFIG_MACH_VSCOM_BALTOS) += barebox-am33xx-baltos.img
+
+pblx-$(CONFIG_MACH_VSCOM_BALTOS) += start_am33xx_baltos_sram
+FILE_barebox-am33xx-baltos-mlo.img = start_am33xx_baltos_sram.pblx.mlo
+am33xx-mlo-$(CONFIG_MACH_VSCOM_BALTOS) += barebox-am33xx-baltos-mlo.img
+
ifdef CONFIG_OMAP_BUILD_IFT
image-y += $(am33xx-mlo-y)
else
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply related
* Aw: Re: why UBI static volumes are flagged as DEVFS_IS_CHARACTER_DEV
From: iw3gtf @ 2016-10-06 9:20 UTC (permalink / raw)
To: t.remmet; +Cc: barebox
In-Reply-To: <1475741847.3468.20.camel@lws-tremmet.phytec.de>
----- Original Nachricht ----
Von: Teresa Remmet <t.remmet@phytec.de>
An: iw3gtf@arcor.de
Datum: 06.10.2016 10:17
Betreff: Re: why UBI static volumes are flagged as DEVFS_IS_CHARACTER_DEV
> Hello Giorgio,
>
> Am Mittwoch, den 05.10.2016, 15:23 +0200 schrieb iw3gtf@arcor.de:
> > Hi,
> >
> > I noticed that the commit id c087e0804f0290e9886899e8a3cccb07c4ce088b
> flagged static
> > UBI volumes as DEVFS_IS_CHARACTER_DEV.
> >
> > A consequence of this flag is that commands like:
> >
> > # cp /dev/nand0.ubi_volumes.ubi.my_static_vol file
> >
> > will not work because the cp command will see a src file (the static UBI
> volume) with a size
> > of -1 (FILE_SIZE_STREAM) and keep on reading from the volume until a flood
> of
> > "UBI assert failed in ubi_eba_read_leb at 359" asserts comes out of the
> console.
> >
> > I tried to comment out the flag assignment, just to see what happen:
> >
> > int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
> > {
> > ...
> > cdev->size = vol->used_bytes;
> >
> > // if (vol->vol_type == UBI_STATIC_VOLUME)
> > // cdev->flags = DEVFS_IS_CHARACTER_DEV;
> >
> > cdev->dev = &vol->dev;
> > ...
> >
> > and then the cp command worked than as expected.
> >
> > Could someone shortly confirm that the DEVFS_IS_CHARACTER_DEV flag for
> static UBI volumes
> > is really needed (to avoid some other problems that my superficial test
> does not triggers) ?
>
> the size of a static ubi volume device is equal to the image size you
> flashed. When you create a new static ubi volume the size is 0, as it is
> empty.
> We need the chardev flag to be able to update the static ubi volume or
> barebox will complain that there is not enough space.
>
> Regards,
> Teresa
>
Hi,
thanks for the answer, I knew there must be a reason for it.
Nonetheless it is a bit annoying not to be able to simply extract the content
of a static volume.
In my application the static volume contains a barebox bootloader image for an
imx25 cpu, I used to copy it to an mtd partition at the beginning of the nand flash
with the commands: erase /dev/nand0.barebox ; cp /dev/nand0.ubi_volumes... /dev/barebox
This does not work anymore now.
With a newer imx6 cpu I use the command barebox_update -y /dev/nand0.ubi_volumes...,
this works as expected.
Maybe I should write a new barebox_update command variant for the older cpu.
giorgio
Giorgio, iw3gtf@arcor.de
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* am335x: memory configuration
From: Yegor Yefremov @ 2016-10-06 9:08 UTC (permalink / raw)
To: barebox
I've submitted a patch [1] to support our Baltos systems back in the
May. There was an issue with dynamically detecting RAM size as the
systems can have either 256MB or 512MB modules.
So far u-boot was able to detect the RAM size dynamically. In order to
do so it uses following code in arch/arm/cpu/armv7/am33xx/emif4.c:
int dram_init(void)
{
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
sdram_init();
#endif
/* dram_init must store complete ramsize in gd->ram_size */
gd->ram_size = get_ram_size(
(void *)CONFIG_SYS_SDRAM_BASE,
CONFIG_MAX_RAM_BANK_SIZE);
return 0;
}
void dram_init_banksize(void)
{
gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
gd->bd->bi_dram[0].size = gd->ram_size;
}
This peace of code will be excuted in u-boot.img (not in MLO).
In Barebox we have get_ram_size(), that provides real RAM size and
am335x_sdram_size(), that returns RAM controller settings. So far DDR
controler will be configured for 512MB regardless of the module. Hence
the return value from am335x_sdram_size() cannot be used for crating
ram0 node.
What were the best way to provide get_ram_size() from lowlevel.c to
board.c, where I would invoke:
arm_add_mem_device("ram0", 0x80000000, sdram_size);
[1] http://lists.infradead.org/pipermail/barebox/2016-May/027224.html
Yegor
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* Re: why UBI static volumes are flagged as DEVFS_IS_CHARACTER_DEV
From: Teresa Remmet @ 2016-10-06 8:17 UTC (permalink / raw)
To: iw3gtf; +Cc: barebox
In-Reply-To: <1382352141.1327180.1475673795806.JavaMail.ngmail@webmail09.arcor-online.net>
Hello Giorgio,
Am Mittwoch, den 05.10.2016, 15:23 +0200 schrieb iw3gtf@arcor.de:
> Hi,
>
> I noticed that the commit id c087e0804f0290e9886899e8a3cccb07c4ce088b flagged static
> UBI volumes as DEVFS_IS_CHARACTER_DEV.
>
> A consequence of this flag is that commands like:
>
> # cp /dev/nand0.ubi_volumes.ubi.my_static_vol file
>
> will not work because the cp command will see a src file (the static UBI volume) with a size
> of -1 (FILE_SIZE_STREAM) and keep on reading from the volume until a flood of
> "UBI assert failed in ubi_eba_read_leb at 359" asserts comes out of the console.
>
> I tried to comment out the flag assignment, just to see what happen:
>
> int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
> {
> ...
> cdev->size = vol->used_bytes;
>
> // if (vol->vol_type == UBI_STATIC_VOLUME)
> // cdev->flags = DEVFS_IS_CHARACTER_DEV;
>
> cdev->dev = &vol->dev;
> ...
>
> and then the cp command worked than as expected.
>
> Could someone shortly confirm that the DEVFS_IS_CHARACTER_DEV flag for static UBI volumes
> is really needed (to avoid some other problems that my superficial test does not triggers) ?
the size of a static ubi volume device is equal to the image size you
flashed. When you create a new static ubi volume the size is 0, as it is
empty.
We need the chardev flag to be able to update the static ubi volume or
barebox will complain that there is not enough space.
Regards,
Teresa
>
> giorgio
>
>
> Giorgio, iw3gtf@arcor.de
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
* why UBI static volumes are flagged as DEVFS_IS_CHARACTER_DEV
From: iw3gtf @ 2016-10-05 13:23 UTC (permalink / raw)
To: barebox
Hi,
I noticed that the commit id c087e0804f0290e9886899e8a3cccb07c4ce088b flagged static
UBI volumes as DEVFS_IS_CHARACTER_DEV.
A consequence of this flag is that commands like:
# cp /dev/nand0.ubi_volumes.ubi.my_static_vol file
will not work because the cp command will see a src file (the static UBI volume) with a size
of -1 (FILE_SIZE_STREAM) and keep on reading from the volume until a flood of
"UBI assert failed in ubi_eba_read_leb at 359" asserts comes out of the console.
I tried to comment out the flag assignment, just to see what happen:
int ubi_volume_cdev_add(struct ubi_device *ubi, struct ubi_volume *vol)
{
...
cdev->size = vol->used_bytes;
// if (vol->vol_type == UBI_STATIC_VOLUME)
// cdev->flags = DEVFS_IS_CHARACTER_DEV;
cdev->dev = &vol->dev;
...
and then the cp command worked than as expected.
Could someone shortly confirm that the DEVFS_IS_CHARACTER_DEV flag for static UBI volumes
is really needed (to avoid some other problems that my superficial test does not triggers) ?
giorgio
Giorgio, iw3gtf@arcor.de
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply
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