Re: [PATCH v2 3/4] commands: ubi: Add ubiupdatevol command
Hello Sascha, Am Dienstag, den 28.06.2016, 07:45 +0200 schrieb Sascha Hauer: > On Mon, Jun 27, 2016 at 01:42:19PM +0200, Teresa Remmet wrote: > > Add ubiupdatevol command. This is to update static > > and dynamic volumes. > > > > Signed-off-by: Teresa Remmet> > --- > > Changes in v2: > > - instead of using read_file, used a smaller > > buffer and read/write in a loop > > > > commands/ubi.c | 81 > > ++ > > 1 file changed, 81 insertions(+) > > > > diff --git a/commands/ubi.c b/commands/ubi.c > > index dc2b4b5..b8b3f38 100644 > > --- a/commands/ubi.c > > +++ b/commands/ubi.c > > @@ -7,10 +7,91 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > > > +static int do_ubiupdatevol(int argc, char *argv[]) > > +{ > > + int fd_img, fd_vol, ret = 0; > > + uint64_t size = 0; > > + struct stat st; > > + unsigned int count; > > + void *buf; > > + > > + if (argc - optind < 2) > > + return COMMAND_ERROR_USAGE; > > + > > + if (stat(argv[optind+1], )) { > > + perror("stat image"); > > + return 1; > > + } > > + > > + size = st.st_size; > > While applying I added a test that tests for FILESIZE_MAX here and bails > out with an error. I could add a check for FILESIZE_MAX and give a special error message in this case. But we need a correct file size for static volumes. So tftp server which do not pass the file size, will fail here. Teresa > > Sascha > ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH] Do not rm the path from pbl-y target
I had to revert this one. The regular expression seems to be wrong. It breaks omap3530_beagle_defconfig with: make[2]: *** No rule to make target 'arch/arm/mach-omap/opbl-map3_clock.o', needed by 'arch/arm/mach-omap/built-in-pbl.o'. Stop. make[2]: *** Waiting for unfinished jobs Instead of pbl-omap3_clock.o it tries to generate opbl-map3_clock.o. Sascha Yes, the regular expression wrong, The flowwing patch should work. ---8<- From 3b1fd574b0e847ceb9e0961ec454f975e1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=BF=A0=E5=B1=B1?=Date: Fri, 24 Jun 2016 19:33:56 +0800 Subject: [PATCH] Do not rm the path from pbl-y target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Whan add some obj in a subdir to lwl-y or pbl-y, like this: lwl-y += subdir/test.o other.o the make process failed: make[2]: *** No rule to make target 'arch/arm/boards/boardname/test.o', \ needed by 'arch/arm/boards/boardname/built-in-pbl.o'. Stop. Note, there are not the part "subdir" in the path of the test.o. this patch fix this Signed-off-by: 张忠山 --- scripts/Makefile.lib | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 27365d8..e55bc27 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -39,10 +39,9 @@ endif obj-y += $(obj-pbl-y) pbl-y += $(obj-pbl-y) -# for non dirs add pbl- prefix to the target -# so we recompile the source with custom flags and custom quiet -__pbl-y:= $(notdir $(pbl-y)) -pbl-y := $(patsubst %.o,pbl-%.o,$(__pbl-y)) +# add pbl- prefix to the target +pbl-y := $(shell echo $(pbl-y) | sed -e 's%\(\([^ \t]\+/\)*\)\([^ \t]*\.o\)%\2pbl-\3%g') + # add subdir from $(obj-y) too so we do not need to have the dir define in # both $(obj-y) and $(pbl-y) __pbl-y:= $(filter-out $(pbl-y), $(filter %/, $(obj-y))) -- 1.9.1 ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v3 03/14] arm: introduce lib64 for arm64 related stuff
2016-06-28 8:47 GMT+02:00 Sascha Hauer: > On Fri, Jun 24, 2016 at 02:23:50PM +0200, Raphael Poggi wrote: >> Signed-off-by: Raphael Poggi >> --- >> arch/arm/lib64/Makefile| 10 + >> arch/arm/lib64/armlinux.c | 104 >> arch/arm/lib64/asm-offsets.c | 16 ++ >> arch/arm/lib64/barebox.lds.S | 125 + >> arch/arm/lib64/bootm.c | 572 >> + >> arch/arm/lib64/copy_template.S | 192 ++ >> arch/arm/lib64/div0.c | 27 ++ >> arch/arm/lib64/memcpy.S| 74 ++ >> arch/arm/lib64/memset.S| 215 >> 9 files changed, 1335 insertions(+) >> create mode 100644 arch/arm/lib64/Makefile >> create mode 100644 arch/arm/lib64/armlinux.c >> create mode 100644 arch/arm/lib64/asm-offsets.c >> create mode 100644 arch/arm/lib64/barebox.lds.S >> create mode 100644 arch/arm/lib64/bootm.c >> create mode 100644 arch/arm/lib64/copy_template.S >> create mode 100644 arch/arm/lib64/div0.c >> create mode 100644 arch/arm/lib64/memcpy.S >> create mode 100644 arch/arm/lib64/memset.S >> >> diff --git a/arch/arm/lib64/Makefile b/arch/arm/lib64/Makefile >> new file mode 100644 >> index 000..a424293 >> --- /dev/null >> +++ b/arch/arm/lib64/Makefile >> @@ -0,0 +1,10 @@ >> +obj-$(CONFIG_ARM_LINUX) += armlinux.o >> +obj-$(CONFIG_BOOTM) += bootm.o >> +obj-y+= div0.o >> +obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memcpy.o >> +obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memset.o >> +extra-y += barebox.lds >> + >> +pbl-y+= lib1funcs.o >> +pbl-y+= ashldi3.o >> +pbl-y+= div0.o >> diff --git a/arch/arm/lib64/armlinux.c b/arch/arm/lib64/armlinux.c >> new file mode 100644 >> index 000..c70e079 >> --- /dev/null >> +++ b/arch/arm/lib64/armlinux.c >> @@ -0,0 +1,104 @@ >> +/* >> + * (C) Copyright 2002 >> + * Sysgo Real-Time Solutions, GmbH >> + * Marius Groeger >> + * >> + * Copyright (C) 2001 Erik Mouw (j.a.k.m...@its.tudelft.nl) >> + * >> + * 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. >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +static void *armlinux_bootparams = NULL; >> + >> +static int armlinux_architecture; >> +static u32 armlinux_system_rev; >> +static u64 armlinux_system_serial; >> + >> +BAREBOX_MAGICVAR(armlinux_architecture, "ARM machine ID"); >> +BAREBOX_MAGICVAR(armlinux_system_rev, "ARM system revision"); >> +BAREBOX_MAGICVAR(armlinux_system_serial, "ARM system serial"); >> + >> +void armlinux_set_architecture(int architecture) >> +{ >> + export_env_ull("armlinux_architecture", architecture); >> + armlinux_architecture = architecture; >> +} >> + >> +int armlinux_get_architecture(void) >> +{ >> + getenv_uint("armlinux_architecture", _architecture); >> + >> + return armlinux_architecture; >> +} >> + >> +void armlinux_set_revision(unsigned int rev) >> +{ >> + export_env_ull("armlinux_system_rev", rev); >> + armlinux_system_rev = rev; >> +} >> + >> +unsigned int armlinux_get_revision(void) >> +{ >> + getenv_uint("armlinux_system_rev", _system_rev); >> + >> + return armlinux_system_rev; >> +} >> + >> +void armlinux_set_serial(u64 serial) >> +{ >> + export_env_ull("armlinux_system_serial", serial); >> + armlinux_system_serial = serial; >> +} >> + >> +u64 armlinux_get_serial(void) >> +{ >> + getenv_ull("armlinux_system_serial", _system_serial); >> + >> + return armlinux_system_serial; >> +} >> + >> +void armlinux_set_bootparams(void *params) >> +{ >> + armlinux_bootparams = params; >> +} > > All of the above is not needed. Sorry, it seems I overlooked this last > time. Ok for that, I will only let the "start_linux" function. > >> diff --git a/arch/arm/lib64/bootm.c b/arch/arm/lib64/bootm.c > > I still think this file should not be here. You can always copy/modify > it from the arm32 bootm.c once you need it, but at the moment this file > is the reason this patch can't be applied. I'd really like to > review/apply a "arm64: Add bootm code" patch once it's ready. I understand, but since bootm is needed for booting (especially via do_bootm_linux) and also lib/bootm.c is not compiled in
Re: [PATCH v3 06/14] arm: cpu: start: arm64 does not support relocation
On Tue, Jun 28, 2016 at 09:01:14AM +0200, Raphaël Poggi wrote: > 2016-06-28 8:50 GMT+02:00 Sascha Hauer: > > On Fri, Jun 24, 2016 at 02:23:53PM +0200, Raphael Poggi wrote: > >> For now, the relocation is not supported in arm64, so > >> enclosed call to "setup_c" with #if directive > >> > >> Signed-off-by: Raphael Poggi > >> --- > >> arch/arm/cpu/start.c | 2 ++ > >> 1 file changed, 2 insertions(+) > >> > >> diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c > >> index e037d91..5051115 100644 > >> --- a/arch/arm/cpu/start.c > >> +++ b/arch/arm/cpu/start.c > >> @@ -151,7 +151,9 @@ __noreturn void barebox_non_pbl_start(unsigned long > >> membase, > >> relocate_to_adr(barebox_base); > >> } > >> > >> +#if __LINUX_ARM_ARCH__ <= 7 > >> setup_c(); > >> +#endif > > > > setup_c not only relocates the binary, it also clears the bss segment. > > Where is this done on arm64? > > It is not done...I forgot about that. > > I will create a setupc_64.S, in the first time, this will only clear > bss. Later, we could also add relocation support. Ok, that should do it for now. 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v3 06/14] arm: cpu: start: arm64 does not support relocation
2016-06-28 8:50 GMT+02:00 Sascha Hauer: > On Fri, Jun 24, 2016 at 02:23:53PM +0200, Raphael Poggi wrote: >> For now, the relocation is not supported in arm64, so >> enclosed call to "setup_c" with #if directive >> >> Signed-off-by: Raphael Poggi >> --- >> arch/arm/cpu/start.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c >> index e037d91..5051115 100644 >> --- a/arch/arm/cpu/start.c >> +++ b/arch/arm/cpu/start.c >> @@ -151,7 +151,9 @@ __noreturn void barebox_non_pbl_start(unsigned long >> membase, >> relocate_to_adr(barebox_base); >> } >> >> +#if __LINUX_ARM_ARCH__ <= 7 >> setup_c(); >> +#endif > > setup_c not only relocates the binary, it also clears the bss segment. > Where is this done on arm64? It is not done...I forgot about that. I will create a setupc_64.S, in the first time, this will only clear bss. Later, we could also add relocation support. Raphaël > > 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- | > > ___ > 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
Re: [PATCH v3 11/14] arm: cpu: add basic arm64 mmu support
On Fri, Jun 24, 2016 at 02:23:58PM +0200, Raphael Poggi wrote: > + > + pr_debug("ttb: 0x%p\n", ttb); > + > + /* create a flat mapping using 1MiB sections */ > + create_sections(0, 0, GRANULE_SIZE, UNCACHED_MEM); > + > + /* > + * First remap sdram cached using sections. > + * This is to speed up the generation of 2nd level page tables > + * below > + */ The comment seems to be inaccurate here. There is no 2nd level page table generation below. 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v2 5/6] state: backend_storage_direct: also use cached data on write
On Tue, Jun 28, 2016 at 08:18:47AM +0200, Sascha Hauer wrote: > On Fri, Jun 24, 2016 at 12:06:01PM +0200, Markus Pargmann wrote: > > From: Michael Grzeschik> > > > Signed-off-by: Michael Grzeschik > > Signed-off-by: Markus Pargmann > > --- > > common/state/backend_bucket_direct.c | 55 > > > > 1 file changed, 55 insertions(+) > > What's the problem this patch tries to solve? The backend storage is writing the first correct bucket data it finds back to each copy. Therefor every bucket got written on every boot. Even if the content did not change. The direct backend was missing an cache that represent the current data in the buckets. This patch adds the cache and improves the bootup time on systems with direct bucket storage like eeproms. Michael > Sascha > > > > > diff --git a/common/state/backend_bucket_direct.c > > b/common/state/backend_bucket_direct.c > > index 08892f001e25..772267f6dc1d 100644 > > --- a/common/state/backend_bucket_direct.c > > +++ b/common/state/backend_bucket_direct.c > > @@ -29,6 +29,10 @@ struct state_backend_storage_bucket_direct { > > > > int fd; > > > > + /* Cached data of the last read/write */ > > + u8 *current_data; > > + ssize_t current_data_len; > > + > > struct device_d *dev; > > }; > > > > @@ -99,6 +103,29 @@ static int state_backend_bucket_direct_read(struct > > state_backend_storage_bucket > > return 0; > > } > > > > + > > +static int state_backend_bucket_direct_fill_cache( > > + struct state_backend_storage_bucket *bucket) > > +{ > > + struct state_backend_storage_bucket_direct *direct = > > + get_bucket_direct(bucket); > > + ssize_t read_len; > > + uint8_t *buf; > > + int ret; > > + > > + ret = state_backend_bucket_direct_read(bucket, , _len); > > + if (ret < 0) { > > + dev_err(direct->dev, "Failed to read from file, %d\n", ret); > > + free(buf); > > + return ret; > > + } > > + > > + direct->current_data = buf; > > + direct->current_data_len = read_len; > > + > > + return 0; > > +} > > + > > static int state_backend_bucket_direct_write(struct > > state_backend_storage_bucket > > *bucket, const uint8_t * buf, > > ssize_t len) > > @@ -111,6 +138,11 @@ static int state_backend_bucket_direct_write(struct > > state_backend_storage_bucket > > if (direct->max_size && len > direct->max_size) > > return -E2BIG; > > > > + /* Nothing in cache? Then read to see what is on the device currently */ > > + if (!direct->current_data) { > > + state_backend_bucket_direct_fill_cache(bucket); > > + } > > + > > ret = lseek(direct->fd, direct->offset, SEEK_SET); > > if (ret < 0) { > > dev_err(direct->dev, "Failed to seek file, %d\n", ret); > > @@ -119,6 +151,26 @@ static int state_backend_bucket_direct_write(struct > > state_backend_storage_bucket > > > > meta.magic = direct_magic; > > meta.written_length = len; > > + > > + /* > > +* If we would write the same data that is currently on the device, we > > +* can return successfully without writing. > > +* Note that the cache may still be empty if the storage is empty or > > +* errors occured. > > +*/ > > + if (direct->current_data) { > > + dev_dbg(direct->dev, "Comparing cached data, writing %zd bytes, > > cached %zd bytes\n", > > + len, direct->current_data_len); > > + if (len == direct->current_data_len && > > + !memcmp(direct->current_data, buf, len)) { > > + dev_dbg(direct->dev, "Data already on device, not > > writing again\n"); > > + return ret; > > + } else { > > + free(direct->current_data); > > + direct->current_data = NULL; > > + } > > + } > > + > > ret = write_full(direct->fd, , sizeof(meta)); > > if (ret < 0) { > > dev_err(direct->dev, "Failed to write metadata to file, %d\n", > > ret); > > @@ -147,6 +199,9 @@ static void state_backend_bucket_direct_free(struct > > struct state_backend_storage_bucket_direct *direct = > > get_bucket_direct(bucket); > > > > + if (direct->current_data) > > + free(direct->current_data); > > + > > close(direct->fd); > > free(direct); > > } > > -- > > 2.8.1 > > > > > > ___ > > 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
Re: [PATCH v3 06/14] arm: cpu: start: arm64 does not support relocation
On Fri, Jun 24, 2016 at 02:23:53PM +0200, Raphael Poggi wrote: > For now, the relocation is not supported in arm64, so > enclosed call to "setup_c" with #if directive > > Signed-off-by: Raphael Poggi> --- > arch/arm/cpu/start.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm/cpu/start.c b/arch/arm/cpu/start.c > index e037d91..5051115 100644 > --- a/arch/arm/cpu/start.c > +++ b/arch/arm/cpu/start.c > @@ -151,7 +151,9 @@ __noreturn void barebox_non_pbl_start(unsigned long > membase, > relocate_to_adr(barebox_base); > } > > +#if __LINUX_ARM_ARCH__ <= 7 > setup_c(); > +#endif setup_c not only relocates the binary, it also clears the bss segment. Where is this done on arm64? 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v3 03/14] arm: introduce lib64 for arm64 related stuff
On Fri, Jun 24, 2016 at 02:23:50PM +0200, Raphael Poggi wrote: > Signed-off-by: Raphael Poggi> --- > arch/arm/lib64/Makefile| 10 + > arch/arm/lib64/armlinux.c | 104 > arch/arm/lib64/asm-offsets.c | 16 ++ > arch/arm/lib64/barebox.lds.S | 125 + > arch/arm/lib64/bootm.c | 572 > + > arch/arm/lib64/copy_template.S | 192 ++ > arch/arm/lib64/div0.c | 27 ++ > arch/arm/lib64/memcpy.S| 74 ++ > arch/arm/lib64/memset.S| 215 > 9 files changed, 1335 insertions(+) > create mode 100644 arch/arm/lib64/Makefile > create mode 100644 arch/arm/lib64/armlinux.c > create mode 100644 arch/arm/lib64/asm-offsets.c > create mode 100644 arch/arm/lib64/barebox.lds.S > create mode 100644 arch/arm/lib64/bootm.c > create mode 100644 arch/arm/lib64/copy_template.S > create mode 100644 arch/arm/lib64/div0.c > create mode 100644 arch/arm/lib64/memcpy.S > create mode 100644 arch/arm/lib64/memset.S > > diff --git a/arch/arm/lib64/Makefile b/arch/arm/lib64/Makefile > new file mode 100644 > index 000..a424293 > --- /dev/null > +++ b/arch/arm/lib64/Makefile > @@ -0,0 +1,10 @@ > +obj-$(CONFIG_ARM_LINUX) += armlinux.o > +obj-$(CONFIG_BOOTM) += bootm.o > +obj-y+= div0.o > +obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memcpy.o > +obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memset.o > +extra-y += barebox.lds > + > +pbl-y+= lib1funcs.o > +pbl-y+= ashldi3.o > +pbl-y+= div0.o > diff --git a/arch/arm/lib64/armlinux.c b/arch/arm/lib64/armlinux.c > new file mode 100644 > index 000..c70e079 > --- /dev/null > +++ b/arch/arm/lib64/armlinux.c > @@ -0,0 +1,104 @@ > +/* > + * (C) Copyright 2002 > + * Sysgo Real-Time Solutions, GmbH > + * Marius Groeger > + * > + * Copyright (C) 2001 Erik Mouw (j.a.k.m...@its.tudelft.nl) > + * > + * 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. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +static void *armlinux_bootparams = NULL; > + > +static int armlinux_architecture; > +static u32 armlinux_system_rev; > +static u64 armlinux_system_serial; > + > +BAREBOX_MAGICVAR(armlinux_architecture, "ARM machine ID"); > +BAREBOX_MAGICVAR(armlinux_system_rev, "ARM system revision"); > +BAREBOX_MAGICVAR(armlinux_system_serial, "ARM system serial"); > + > +void armlinux_set_architecture(int architecture) > +{ > + export_env_ull("armlinux_architecture", architecture); > + armlinux_architecture = architecture; > +} > + > +int armlinux_get_architecture(void) > +{ > + getenv_uint("armlinux_architecture", _architecture); > + > + return armlinux_architecture; > +} > + > +void armlinux_set_revision(unsigned int rev) > +{ > + export_env_ull("armlinux_system_rev", rev); > + armlinux_system_rev = rev; > +} > + > +unsigned int armlinux_get_revision(void) > +{ > + getenv_uint("armlinux_system_rev", _system_rev); > + > + return armlinux_system_rev; > +} > + > +void armlinux_set_serial(u64 serial) > +{ > + export_env_ull("armlinux_system_serial", serial); > + armlinux_system_serial = serial; > +} > + > +u64 armlinux_get_serial(void) > +{ > + getenv_ull("armlinux_system_serial", _system_serial); > + > + return armlinux_system_serial; > +} > + > +void armlinux_set_bootparams(void *params) > +{ > + armlinux_bootparams = params; > +} All of the above is not needed. Sorry, it seems I overlooked this last time. > diff --git a/arch/arm/lib64/bootm.c b/arch/arm/lib64/bootm.c I still think this file should not be here. You can always copy/modify it from the arm32 bootm.c once you need it, but at the moment this file is the reason this patch can't be applied. I'd really like to review/apply a "arm64: Add bootm code" patch once it's ready. 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- | ___ barebox mailing list
Re: [PATCH 1/3] MIPS: ath79: pbl: add pbl_ar9331_wmac_enable macro
On Mon, Jun 27, 2016 at 12:34:43PM +0200, yegorsli...@googlemail.com wrote: > From: Yegor Yefremov> > AR9331's WMAC module requires triple WMAC reset as also working RTC > subsystem. > > The code is taken as is from upstream U-Boot repository. > > Signed-off-by: Yegor Yefremov Applied, thanks Sascha > --- > arch/mips/mach-ath79/include/mach/ar71xx_regs.h | 14 ++ > arch/mips/mach-ath79/include/mach/pbl_macros.h | 63 > + > 2 files changed, 77 insertions(+) > > diff --git a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h > b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h > index 4cbe94a..de96c56 100644 > --- a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h > +++ b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h > @@ -31,11 +31,25 @@ > #define AR71XX_PLL_SIZE 0x100 > #define AR71XX_RESET_BASE(AR71XX_APB_BASE + 0x0006) > #define AR71XX_RESET_SIZE0x100 > +#define AR71XX_RTC_BASE (AR71XX_APB_BASE + 0x00107000) > +#define AR71XX_RTC_SIZE 0x100 > > #define AR933X_UART_BASE (AR71XX_APB_BASE + 0x0002) > #define AR933X_UART_SIZE 0x14 > > /* > + * RTC block > + */ > +#define AR933X_RTC_REG_RESET 0x40 > +#define AR933X_RTC_REG_STATUS0x44 > +#define AR933X_RTC_REG_DERIVED 0x48 > +#define AR933X_RTC_REG_FORCE_WAKE0x4c > +#define AR933X_RTC_REG_INT_CAUSE 0x50 > +#define AR933X_RTC_REG_CAUSE_CLR 0x50 > +#define AR933X_RTC_REG_INT_ENABLE0x54 > +#define AR933X_RTC_REG_INT_MASKE 0x58 > + > +/* > * DDR_CTRL block > */ > #define AR933X_DDR_CONFIG0x00 > diff --git a/arch/mips/mach-ath79/include/mach/pbl_macros.h > b/arch/mips/mach-ath79/include/mach/pbl_macros.h > index 8f4d09a..680fcbb 100644 > --- a/arch/mips/mach-ath79/include/mach/pbl_macros.h > +++ b/arch/mips/mach-ath79/include/mach/pbl_macros.h > @@ -274,4 +274,67 @@ normal_path: > .setpop > .endm > > +.macro pbl_ar9331_wmac_enable > + .set push > + .set noreorder > + > + /* These three WLAN_RESET will avoid original issue */ > + li t3, 0x03 > +1: > + li t0, CKSEG1ADDR(AR71XX_RESET_BASE) > + lw t1, AR933X_RESET_REG_RESET_MODULE(t0) > + ori t1, t1, 0x0800 > + sw t1, AR933X_RESET_REG_RESET_MODULE(t0) > + nop > + lw t1, AR933X_RESET_REG_RESET_MODULE(t0) > + li t2, 0xf7ff > + and t1, t1, t2 > + sw t1, AR933X_RESET_REG_RESET_MODULE(t0) > + nop > + addit3, t3, -1 > + bnezt3, 1b > + nop > + > + li t2, 0x20 > +2: > + beqzt2, 1b > + nop > + addit2, t2, -1 > + lw t5, AR933X_RESET_REG_BOOTSTRAP(t0) > + andit1, t5, 0x10 > + bnezt1, 2b > + nop > + > + li t1, 0x02110E > + sw t1, AR933X_RESET_REG_BOOTSTRAP(t0) > + nop > + > + /* RTC Force Wake */ > + li t0, CKSEG1ADDR(AR71XX_RTC_BASE) > + li t1, 0x03 > + sw t1, AR933X_RTC_REG_FORCE_WAKE(t0) > + nop > + nop > + > + /* RTC Reset */ > + li t1, 0x00 > + sw t1, AR933X_RTC_REG_RESET(t0) > + nop > + nop > + > + li t1, 0x01 > + sw t1, AR933X_RTC_REG_RESET(t0) > + nop > + nop > + > + /* Wait for RTC in on state */ > +1: > + lw t1, AR933X_RTC_REG_STATUS(t0) > + andit1, t1, 0x02 > + beqzt1, 1b > + nop > + > + .setpop > +.endm > + > #endif /* __ASM_MACH_ATH79_PBL_MACROS_H */ > -- > 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH v2 5/6] state: backend_storage_direct: also use cached data on write
On Fri, Jun 24, 2016 at 12:06:01PM +0200, Markus Pargmann wrote: > From: Michael Grzeschik> > Signed-off-by: Michael Grzeschik > Signed-off-by: Markus Pargmann > --- > common/state/backend_bucket_direct.c | 55 > > 1 file changed, 55 insertions(+) What's the problem this patch tries to solve? Sascha > > diff --git a/common/state/backend_bucket_direct.c > b/common/state/backend_bucket_direct.c > index 08892f001e25..772267f6dc1d 100644 > --- a/common/state/backend_bucket_direct.c > +++ b/common/state/backend_bucket_direct.c > @@ -29,6 +29,10 @@ struct state_backend_storage_bucket_direct { > > int fd; > > + /* Cached data of the last read/write */ > + u8 *current_data; > + ssize_t current_data_len; > + > struct device_d *dev; > }; > > @@ -99,6 +103,29 @@ static int state_backend_bucket_direct_read(struct > state_backend_storage_bucket > return 0; > } > > + > +static int state_backend_bucket_direct_fill_cache( > + struct state_backend_storage_bucket *bucket) > +{ > + struct state_backend_storage_bucket_direct *direct = > + get_bucket_direct(bucket); > + ssize_t read_len; > + uint8_t *buf; > + int ret; > + > + ret = state_backend_bucket_direct_read(bucket, , _len); > + if (ret < 0) { > + dev_err(direct->dev, "Failed to read from file, %d\n", ret); > + free(buf); > + return ret; > + } > + > + direct->current_data = buf; > + direct->current_data_len = read_len; > + > + return 0; > +} > + > static int state_backend_bucket_direct_write(struct > state_backend_storage_bucket >*bucket, const uint8_t * buf, >ssize_t len) > @@ -111,6 +138,11 @@ static int state_backend_bucket_direct_write(struct > state_backend_storage_bucket > if (direct->max_size && len > direct->max_size) > return -E2BIG; > > + /* Nothing in cache? Then read to see what is on the device currently */ > + if (!direct->current_data) { > + state_backend_bucket_direct_fill_cache(bucket); > + } > + > ret = lseek(direct->fd, direct->offset, SEEK_SET); > if (ret < 0) { > dev_err(direct->dev, "Failed to seek file, %d\n", ret); > @@ -119,6 +151,26 @@ static int state_backend_bucket_direct_write(struct > state_backend_storage_bucket > > meta.magic = direct_magic; > meta.written_length = len; > + > + /* > + * If we would write the same data that is currently on the device, we > + * can return successfully without writing. > + * Note that the cache may still be empty if the storage is empty or > + * errors occured. > + */ > + if (direct->current_data) { > + dev_dbg(direct->dev, "Comparing cached data, writing %zd bytes, > cached %zd bytes\n", > + len, direct->current_data_len); > + if (len == direct->current_data_len && > + !memcmp(direct->current_data, buf, len)) { > + dev_dbg(direct->dev, "Data already on device, not > writing again\n"); > + return ret; > + } else { > + free(direct->current_data); > + direct->current_data = NULL; > + } > + } > + > ret = write_full(direct->fd, , sizeof(meta)); > if (ret < 0) { > dev_err(direct->dev, "Failed to write metadata to file, %d\n", > ret); > @@ -147,6 +199,9 @@ static void state_backend_bucket_direct_free(struct > struct state_backend_storage_bucket_direct *direct = > get_bucket_direct(bucket); > > + if (direct->current_data) > + free(direct->current_data); > + > close(direct->fd); > free(direct); > } > -- > 2.8.1 > > > ___ > 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- | ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox