* OMAP patches @ 2013-09-27 7:17 Sascha Hauer 2013-09-27 7:17 ` [PATCH 1/4] ARM: OMAP: Add missing include Sascha Hauer ` (3 more replies) 0 siblings, 4 replies; 7+ messages in thread From: Sascha Hauer @ 2013-09-27 7:17 UTC (permalink / raw) To: barebox Some OMAP patches Sascha ---------------------------------------------------------------- Sascha Hauer (4): ARM: OMAP: Add missing include ARM: OMAP: register OMAP specific barebox bootm handler ARM: OMAP: unconditionally use /boot/barebox.env i2c: omap: remove unncessary printf arch/arm/mach-omap/include/mach/generic.h | 1 + arch/arm/mach-omap/omap_generic.c | 65 +++++++++++++++++++++++++++---- arch/arm/mach-omap/xload.c | 10 +---- drivers/i2c/busses/i2c-omap.c | 2 +- 4 files changed, 62 insertions(+), 16 deletions(-) _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] ARM: OMAP: Add missing include 2013-09-27 7:17 OMAP patches Sascha Hauer @ 2013-09-27 7:17 ` Sascha Hauer 2013-09-27 7:17 ` [PATCH 2/4] ARM: OMAP: register OMAP specific barebox bootm handler Sascha Hauer ` (2 subsequent siblings) 3 siblings, 0 replies; 7+ messages in thread From: Sascha Hauer @ 2013-09-27 7:17 UTC (permalink / raw) To: barebox Include mach/generic.h where omap_set_bootmmc_devname is declared. Change the argument of omap_set_bootmmc_devname to const char * to fix the resulting conflicting prototypes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- arch/arm/mach-omap/omap_generic.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c index e7ca821..f024de6 100644 --- a/arch/arm/mach-omap/omap_generic.c +++ b/arch/arm/mach-omap/omap_generic.c @@ -20,10 +20,11 @@ #include <fs.h> #include <malloc.h> #include <linux/stat.h> +#include <mach/generic.h> -static char *omap_bootmmc_dev; +const static char *omap_bootmmc_dev; -void omap_set_bootmmc_devname(char *devname) +void omap_set_bootmmc_devname(const char *devname) { omap_bootmmc_dev = devname; } @@ -37,7 +38,8 @@ const char *omap_get_bootmmc_devname(void) static int omap_env_init(void) { struct stat s; - char *diskdev, *partname; + char *partname; + const char *diskdev; int ret; if (bootsource_get() != BOOTSOURCE_MMC) -- 1.8.4.rc3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/4] ARM: OMAP: register OMAP specific barebox bootm handler 2013-09-27 7:17 OMAP patches Sascha Hauer 2013-09-27 7:17 ` [PATCH 1/4] ARM: OMAP: Add missing include Sascha Hauer @ 2013-09-27 7:17 ` Sascha Hauer 2013-09-27 8:25 ` Jean-Christophe PLAGNIOL-VILLARD 2013-09-27 7:17 ` [PATCH 3/4] ARM: OMAP: unconditionally use /boot/barebox.env Sascha Hauer 2013-09-27 7:17 ` [PATCH 4/4] i2c: omap: remove unncessary printf Sascha Hauer 3 siblings, 1 reply; 7+ messages in thread From: Sascha Hauer @ 2013-09-27 7:17 UTC (permalink / raw) To: barebox The OMAP ROM code passes the boot information via r0 to the bootloader. Add an OMAP specific barebox handler to pass this information to the next stage. This allows us to chainload bootloaders without loosing the information where we booted from. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- arch/arm/mach-omap/include/mach/generic.h | 1 + arch/arm/mach-omap/omap_generic.c | 52 +++++++++++++++++++++++++++++++ arch/arm/mach-omap/xload.c | 10 ++---- 3 files changed, 55 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap/include/mach/generic.h b/arch/arm/mach-omap/include/mach/generic.h index ece8c2b..1cd7f04 100644 --- a/arch/arm/mach-omap/include/mach/generic.h +++ b/arch/arm/mach-omap/include/mach/generic.h @@ -56,6 +56,7 @@ static inline int omap_set_mmc_dev(const char *mmcdev) extern uint32_t omap_bootinfo[3]; void omap_save_bootinfo(void *data); +void __noreturn omap_start_barebox(void *barebox); void omap_set_bootmmc_devname(const char *devname); const char *omap_get_bootmmc_devname(void); diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c index f024de6..595ecbe 100644 --- a/arch/arm/mach-omap/omap_generic.c +++ b/arch/arm/mach-omap/omap_generic.c @@ -15,12 +15,64 @@ #include <common.h> #include <bootsource.h> #include <envfs.h> +#include <boot.h> #include <init.h> #include <io.h> #include <fs.h> #include <malloc.h> #include <linux/stat.h> #include <mach/generic.h> +#include <mach/am33xx-silicon.h> +#include <mach/omap3-silicon.h> +#include <mach/omap4-silicon.h> + +static void *omap_sram_start(void) +{ + if (cpu_is_am33xx()) + return (void *)AM33XX_SRAM0_START; + if (cpu_is_omap34xx()) + return (void *)OMAP3_SRAM_BASE; + if (cpu_is_omap4xxx()) + return (void *)OMAP44XX_SRAM_BASE; +} + +void __noreturn omap_start_barebox(void *barebox) +{ + int (*func)(void *) = barebox; + uint32_t *arg; + void *sramadr = omap_sram_start(); + + arg = (uint32_t *)&omap_bootinfo; + + memcpy(sramadr, &omap_bootinfo, sizeof(uint32_t) * 3); + + shutdown_barebox(); + func(sramadr); + hang(); +} + +static int do_bootm_omap_barebox(struct image_data *data) +{ + void (*barebox)(uint32_t); + + barebox = read_file(data->os_file, NULL); + if (!barebox) + return -EINVAL; + + omap_start_barebox(barebox); +} + +static struct image_handler omap_barebox_handler = { + .name = "OMAP barebox", + .bootm = do_bootm_omap_barebox, + .filetype = filetype_arm_barebox, +}; + +static int omap_bootm_barebox(void) +{ + return register_image_handler(&omap_barebox_handler); +} +device_initcall(omap_bootm_barebox); const static char *omap_bootmmc_dev; diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c index b4d1b55..69e3e42 100644 --- a/arch/arm/mach-omap/xload.c +++ b/arch/arm/mach-omap/xload.c @@ -188,8 +188,7 @@ static void *omap4_xload_boot_usb(void){ */ static __noreturn int omap_xload(void) { - int (*func)(void *) = NULL; - uint32_t *arg; + void *func; if (!barebox_part) barebox_part = &default_part; @@ -230,12 +229,7 @@ static __noreturn int omap_xload(void) while (1); } - arg = (uint32_t *)&omap_bootinfo; - - shutdown_barebox(); - func(arg); - - while (1); + omap_start_barebox(func); } int omap_set_barebox_part(struct omap_barebox_part *part) -- 1.8.4.rc3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] ARM: OMAP: register OMAP specific barebox bootm handler 2013-09-27 7:17 ` [PATCH 2/4] ARM: OMAP: register OMAP specific barebox bootm handler Sascha Hauer @ 2013-09-27 8:25 ` Jean-Christophe PLAGNIOL-VILLARD 2013-09-27 8:37 ` Sascha Hauer 0 siblings, 1 reply; 7+ messages in thread From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-27 8:25 UTC (permalink / raw) To: Sascha Hauer; +Cc: barebox On 09:17 Fri 27 Sep , Sascha Hauer wrote: > The OMAP ROM code passes the boot information via r0 to the > bootloader. Add an OMAP specific barebox handler to pass this > information to the next stage. This allows us to chainload > bootloaders without loosing the information where we booted from. as you are working on the xload can test the patch I send to switch to the generic bootstap code Best Regards, J. > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > --- > arch/arm/mach-omap/include/mach/generic.h | 1 + > arch/arm/mach-omap/omap_generic.c | 52 +++++++++++++++++++++++++++++++ > arch/arm/mach-omap/xload.c | 10 ++---- > 3 files changed, 55 insertions(+), 8 deletions(-) > > diff --git a/arch/arm/mach-omap/include/mach/generic.h b/arch/arm/mach-omap/include/mach/generic.h > index ece8c2b..1cd7f04 100644 > --- a/arch/arm/mach-omap/include/mach/generic.h > +++ b/arch/arm/mach-omap/include/mach/generic.h > @@ -56,6 +56,7 @@ static inline int omap_set_mmc_dev(const char *mmcdev) > > extern uint32_t omap_bootinfo[3]; > void omap_save_bootinfo(void *data); > +void __noreturn omap_start_barebox(void *barebox); > > void omap_set_bootmmc_devname(const char *devname); > const char *omap_get_bootmmc_devname(void); > diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c > index f024de6..595ecbe 100644 > --- a/arch/arm/mach-omap/omap_generic.c > +++ b/arch/arm/mach-omap/omap_generic.c > @@ -15,12 +15,64 @@ > #include <common.h> > #include <bootsource.h> > #include <envfs.h> > +#include <boot.h> > #include <init.h> > #include <io.h> > #include <fs.h> > #include <malloc.h> > #include <linux/stat.h> > #include <mach/generic.h> > +#include <mach/am33xx-silicon.h> > +#include <mach/omap3-silicon.h> > +#include <mach/omap4-silicon.h> > + > +static void *omap_sram_start(void) > +{ > + if (cpu_is_am33xx()) > + return (void *)AM33XX_SRAM0_START; > + if (cpu_is_omap34xx()) > + return (void *)OMAP3_SRAM_BASE; > + if (cpu_is_omap4xxx()) > + return (void *)OMAP44XX_SRAM_BASE; > +} > + > +void __noreturn omap_start_barebox(void *barebox) > +{ > + int (*func)(void *) = barebox; > + uint32_t *arg; > + void *sramadr = omap_sram_start(); > + > + arg = (uint32_t *)&omap_bootinfo; > + > + memcpy(sramadr, &omap_bootinfo, sizeof(uint32_t) * 3); > + > + shutdown_barebox(); > + func(sramadr); > + hang(); > +} > + > +static int do_bootm_omap_barebox(struct image_data *data) > +{ > + void (*barebox)(uint32_t); > + > + barebox = read_file(data->os_file, NULL); > + if (!barebox) > + return -EINVAL; > + > + omap_start_barebox(barebox); > +} > + > +static struct image_handler omap_barebox_handler = { > + .name = "OMAP barebox", > + .bootm = do_bootm_omap_barebox, > + .filetype = filetype_arm_barebox, > +}; > + > +static int omap_bootm_barebox(void) > +{ > + return register_image_handler(&omap_barebox_handler); > +} > +device_initcall(omap_bootm_barebox); > > const static char *omap_bootmmc_dev; > > diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c > index b4d1b55..69e3e42 100644 > --- a/arch/arm/mach-omap/xload.c > +++ b/arch/arm/mach-omap/xload.c > @@ -188,8 +188,7 @@ static void *omap4_xload_boot_usb(void){ > */ > static __noreturn int omap_xload(void) > { > - int (*func)(void *) = NULL; > - uint32_t *arg; > + void *func; > > if (!barebox_part) > barebox_part = &default_part; > @@ -230,12 +229,7 @@ static __noreturn int omap_xload(void) > while (1); > } > > - arg = (uint32_t *)&omap_bootinfo; > - > - shutdown_barebox(); > - func(arg); > - > - while (1); > + omap_start_barebox(func); > } > > int omap_set_barebox_part(struct omap_barebox_part *part) > -- > 1.8.4.rc3 > > > _______________________________________________ > 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 [flat|nested] 7+ messages in thread
* Re: [PATCH 2/4] ARM: OMAP: register OMAP specific barebox bootm handler 2013-09-27 8:25 ` Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-27 8:37 ` Sascha Hauer 0 siblings, 0 replies; 7+ messages in thread From: Sascha Hauer @ 2013-09-27 8:37 UTC (permalink / raw) To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox On Fri, Sep 27, 2013 at 10:25:37AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote: > On 09:17 Fri 27 Sep , Sascha Hauer wrote: > > The OMAP ROM code passes the boot information via r0 to the > > bootloader. Add an OMAP specific barebox handler to pass this > > information to the next stage. This allows us to chainload > > bootloaders without loosing the information where we booted from. > > as you are working on the xload can test the patch I send to switch to the > generic bootstap code I could test them on the beaglebone, yes. Sascha > > Best Regards, > J. > > > > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> > > --- > > arch/arm/mach-omap/include/mach/generic.h | 1 + > > arch/arm/mach-omap/omap_generic.c | 52 +++++++++++++++++++++++++++++++ > > arch/arm/mach-omap/xload.c | 10 ++---- > > 3 files changed, 55 insertions(+), 8 deletions(-) > > > > diff --git a/arch/arm/mach-omap/include/mach/generic.h b/arch/arm/mach-omap/include/mach/generic.h > > index ece8c2b..1cd7f04 100644 > > --- a/arch/arm/mach-omap/include/mach/generic.h > > +++ b/arch/arm/mach-omap/include/mach/generic.h > > @@ -56,6 +56,7 @@ static inline int omap_set_mmc_dev(const char *mmcdev) > > > > extern uint32_t omap_bootinfo[3]; > > void omap_save_bootinfo(void *data); > > +void __noreturn omap_start_barebox(void *barebox); > > > > void omap_set_bootmmc_devname(const char *devname); > > const char *omap_get_bootmmc_devname(void); > > diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c > > index f024de6..595ecbe 100644 > > --- a/arch/arm/mach-omap/omap_generic.c > > +++ b/arch/arm/mach-omap/omap_generic.c > > @@ -15,12 +15,64 @@ > > #include <common.h> > > #include <bootsource.h> > > #include <envfs.h> > > +#include <boot.h> > > #include <init.h> > > #include <io.h> > > #include <fs.h> > > #include <malloc.h> > > #include <linux/stat.h> > > #include <mach/generic.h> > > +#include <mach/am33xx-silicon.h> > > +#include <mach/omap3-silicon.h> > > +#include <mach/omap4-silicon.h> > > + > > +static void *omap_sram_start(void) > > +{ > > + if (cpu_is_am33xx()) > > + return (void *)AM33XX_SRAM0_START; > > + if (cpu_is_omap34xx()) > > + return (void *)OMAP3_SRAM_BASE; > > + if (cpu_is_omap4xxx()) > > + return (void *)OMAP44XX_SRAM_BASE; > > +} > > + > > +void __noreturn omap_start_barebox(void *barebox) > > +{ > > + int (*func)(void *) = barebox; > > + uint32_t *arg; > > + void *sramadr = omap_sram_start(); > > + > > + arg = (uint32_t *)&omap_bootinfo; > > + > > + memcpy(sramadr, &omap_bootinfo, sizeof(uint32_t) * 3); > > + > > + shutdown_barebox(); > > + func(sramadr); > > + hang(); > > +} > > + > > +static int do_bootm_omap_barebox(struct image_data *data) > > +{ > > + void (*barebox)(uint32_t); > > + > > + barebox = read_file(data->os_file, NULL); > > + if (!barebox) > > + return -EINVAL; > > + > > + omap_start_barebox(barebox); > > +} > > + > > +static struct image_handler omap_barebox_handler = { > > + .name = "OMAP barebox", > > + .bootm = do_bootm_omap_barebox, > > + .filetype = filetype_arm_barebox, > > +}; > > + > > +static int omap_bootm_barebox(void) > > +{ > > + return register_image_handler(&omap_barebox_handler); > > +} > > +device_initcall(omap_bootm_barebox); > > > > const static char *omap_bootmmc_dev; > > > > diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c > > index b4d1b55..69e3e42 100644 > > --- a/arch/arm/mach-omap/xload.c > > +++ b/arch/arm/mach-omap/xload.c > > @@ -188,8 +188,7 @@ static void *omap4_xload_boot_usb(void){ > > */ > > static __noreturn int omap_xload(void) > > { > > - int (*func)(void *) = NULL; > > - uint32_t *arg; > > + void *func; > > > > if (!barebox_part) > > barebox_part = &default_part; > > @@ -230,12 +229,7 @@ static __noreturn int omap_xload(void) > > while (1); > > } > > > > - arg = (uint32_t *)&omap_bootinfo; > > - > > - shutdown_barebox(); > > - func(arg); > > - > > - while (1); > > + omap_start_barebox(func); > > } > > > > int omap_set_barebox_part(struct omap_barebox_part *part) > > -- > > 1.8.4.rc3 > > > > > > _______________________________________________ > > 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 [flat|nested] 7+ messages in thread
* [PATCH 3/4] ARM: OMAP: unconditionally use /boot/barebox.env 2013-09-27 7:17 OMAP patches Sascha Hauer 2013-09-27 7:17 ` [PATCH 1/4] ARM: OMAP: Add missing include Sascha Hauer 2013-09-27 7:17 ` [PATCH 2/4] ARM: OMAP: register OMAP specific barebox bootm handler Sascha Hauer @ 2013-09-27 7:17 ` Sascha Hauer 2013-09-27 7:17 ` [PATCH 4/4] i2c: omap: remove unncessary printf Sascha Hauer 3 siblings, 0 replies; 7+ messages in thread From: Sascha Hauer @ 2013-09-27 7:17 UTC (permalink / raw) To: barebox The startup process falls back to /dev/defaultenv automatically, no need to decide here. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- arch/arm/mach-omap/omap_generic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c index 595ecbe..517cc2c 100644 --- a/arch/arm/mach-omap/omap_generic.c +++ b/arch/arm/mach-omap/omap_generic.c @@ -122,10 +122,7 @@ static int omap_env_init(void) return 0; } - if (IS_ENABLED(CONFIG_OMAP_BUILD_IFT)) - default_environment_path = "/dev/defaultenv"; - else - default_environment_path = "/boot/barebox.env"; + default_environment_path = "/boot/barebox.env"; return 0; } -- 1.8.4.rc3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 4/4] i2c: omap: remove unncessary printf 2013-09-27 7:17 OMAP patches Sascha Hauer ` (2 preceding siblings ...) 2013-09-27 7:17 ` [PATCH 3/4] ARM: OMAP: unconditionally use /boot/barebox.env Sascha Hauer @ 2013-09-27 7:17 ` Sascha Hauer 3 siblings, 0 replies; 7+ messages in thread From: Sascha Hauer @ 2013-09-27 7:17 UTC (permalink / raw) To: barebox A printf in the driver should be dev_* and contain useful information. Both is not the case, remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- drivers/i2c/busses/i2c-omap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 2eb51334..52ffdbb 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -791,7 +791,7 @@ i2c_omap_probe(struct device_d *pdev) i2c_omap->speed = speed; i2c_omap->base = dev_request_mem_region(pdev, 0); - printf ("I2C probe\n"); + omap_i2c_unidle(i2c_omap); i2c_omap->rev = omap_i2c_read_reg(i2c_omap, OMAP_I2C_REV_REG) & 0xff; -- 1.8.4.rc3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-09-27 8:37 UTC | newest] Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-09-27 7:17 OMAP patches Sascha Hauer 2013-09-27 7:17 ` [PATCH 1/4] ARM: OMAP: Add missing include Sascha Hauer 2013-09-27 7:17 ` [PATCH 2/4] ARM: OMAP: register OMAP specific barebox bootm handler Sascha Hauer 2013-09-27 8:25 ` Jean-Christophe PLAGNIOL-VILLARD 2013-09-27 8:37 ` Sascha Hauer 2013-09-27 7:17 ` [PATCH 3/4] ARM: OMAP: unconditionally use /boot/barebox.env Sascha Hauer 2013-09-27 7:17 ` [PATCH 4/4] i2c: omap: remove unncessary printf Sascha Hauer
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox