RPi mailbox support
Subsystems (5)
cover RPi mailbox support
This adds a bcm2835 mailbox driver for the RPi to talk to the on-SoC VideoCore. See [1] for a description.
This patchset uses it to get two properties, the eMMC clock and the memory size.
The RPi backend needs to use this driver early on, namely before the MMU setup. We also want to use the driver in the future after the MMU setup, like setting up simplefb for the kernel. Patch 1 and 2 lay the groundwork for that.
The mailbox driver also needs to handle timouts, so patch 5 and 6 are making the clocksource accessible earlier.
Patch 7 is the driver itself, providing a helper macro for users based on a new common macro from patch 3.
Patch 8 and 9 switch the bc2835_mci driver from a local mailbox implementation to the new driver.
Patch 10 uses the driver to get the proper memory size.
Patch 4 is just a cleanup.
Thanks,
Andre
[1] https://github.com/raspberrypi/firmware/wiki/Mailboxes
Andre Heider (10):
ARM: cache: restore cache functions from the PBL
ARM: cache: do not crash when the MMU isn't yet setup
common: add a macro to align an array on the stack
ARM: bcm2835: cleanup clock registering
ARM: bcm2835: register the clocksource driver earlier
ARM: bcm2835: register the clocksource device earlier
ARM: bcm2835: add a mailbox driver for VideoCore
ARM: rpi: register a clkdev for the eMMC clock
mci: bcm2835: use the registered device clkdev
ARM: rpi: use the proper ARM memory size
arch/arm/boards/raspberry-pi/rpi.c | 75 +++++- arch/arm/cpu/cache.c | 18 +- arch/arm/cpu/start.c | 4 +- arch/arm/mach-bcm2835/Makefile | 2 +- arch/arm/mach-bcm2835/core.c | 32 +-- arch/arm/mach-bcm2835/include/mach/mbox.h | 420 ++++++++++++++++++++++++++++++ arch/arm/mach-bcm2835/mbox.c | 152 +++++++++++ drivers/clocksource/bcm2835.c | 2 +- drivers/mci/mci-bcm2835.c | 93 ++----- drivers/mci/mci-bcm2835.h | 48 ---- include/common.h | 11 + 11 files changed, 700 insertions(+), 157 deletions(-) create mode 100644 arch/arm/mach-bcm2835/include/mach/mbox.h create mode 100644 arch/arm/mach-bcm2835/mbox.c
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/10 ARM: cache: restore cache functions from the PBL
When using CONFIG_MMU_EARLY combined with CONFIG_PBL_IMAGE, the barebox setup reuses the MMU setup from the PBL, but doesn't setup the cache functions.
Set these up to guarantee proper early cache handing before mmu_initcall().
--- arch/arm/cpu/start.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/cpu/start.c +3 -1
@@ -70,7 +70,9 @@ static noinline __noreturn void __start(uint32_t membase, uint32_t memsize, endmem &= ~0x3fff ; endmem -=SZ_16K ;/* ttb */ -if (!IS_ENABLED (CONFIG_PBL_IMAGE )) { +if (IS_ENABLED (CONFIG_PBL_IMAGE )) { +arm_set_cache_functions (); + }else {arm_early_mmu_cache_invalidate ();mmu_early_enable (membase, memsize, endmem); }
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/10 ARM: cache: do not crash when the MMU isn't yet setup
In reply to Andre HeiderDrivers currently cannot implement explicit cache handling and rely on running the same code before and after mmu_initcall() without crashing.
Depending on the chosen config options, the cache functions are not yet setup and using them early on ends in a null pointer dereference.
The RPi's mailbox driver is such a case; it requires cache handling once the MMU is fully set up and yet the RPi setup needs to use the driver to get the memory size before mem_initcall() and hence mmu_initcall().
Fix this by checking the cache_fns pointer before dereferencing it.
--- arch/arm/cpu/cache.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
arch/arm/cpu/cache.c +12 -6
@@ -41,32 +41,38 @@ DEFINE_CPU_FNS(v7)void __dma_clean_range (unsigned long start,unsigned long end) { - cache_fns->dma_clean_range (start, end); +if (cache_fns) + cache_fns->dma_clean_range (start, end); }void __dma_flush_range (unsigned long start,unsigned long end) { - cache_fns->dma_flush_range (start, end); +if (cache_fns) + cache_fns->dma_flush_range (start, end); }void __dma_inv_range (unsigned long start,unsigned long end) { - cache_fns->dma_inv_range (start, end); +if (cache_fns) + cache_fns->dma_inv_range (start, end); }void __mmu_cache_on (void ) { - cache_fns->mmu_cache_on (); +if (cache_fns) + cache_fns->mmu_cache_on (); }void __mmu_cache_off (void ) { - cache_fns->mmu_cache_off (); +if (cache_fns) + cache_fns->mmu_cache_off (); }void __mmu_cache_flush (void ) { - cache_fns->mmu_cache_flush (); +if (cache_fns) + cache_fns->mmu_cache_flush (); }int arm_set_cache_functions (void )
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/10 common: add a macro to align an array on the stack
In reply to Andre HeiderThe macro can be used for temporary stack buffers which need to meet a minimum alignment requirement.
This will be used by bcm2835 mailbox users, where all buffers need to be aligned.
--- include/common.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
include/common.h +11 -0
@@ -192,6 +192,17 @@ int run_shell(void);#define ARRAY_SIZE (arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))#define ARRAY_AND_SIZE (x) (x), ARRAY_SIZE(x) +/* +* The STACK_ALIGN_ARRAY macro is used to allocate a buffer on the stack that +* meets a minimum alignment requirement. +* +* Note that the size parameter is the number of array elements to allocate, +* not the number of bytes. +*/ +#define STACK_ALIGN_ARRAY (type, name, size, align) \ + char __##name[sizeof(type) * (size) + (align) - 1]; \ + type *name = (type *)ALIGN((uintptr_t)__##name, align) +/** * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the member.
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 4/10 ARM: bcm2835: cleanup clock registering
In reply to Andre HeiderSync exposed names while at it.
--- arch/arm/mach-bcm2835/core.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-)
arch/arm/mach-bcm2835/core.c +7 -24
@@ -32,37 +32,20 @@#include <mach/core.h> #include <linux/amba/bus.h> -enum brcm_clks { - dummy, clk_ref_3, clk_ref_1, clks_max -}; - -static struct clk *clks[clks_max]; -static int bcm2835_clk_init (void ) { -int ret; - - clks[dummy] =clk_fixed ("dummy" ,0 ); - clks[clk_ref_3] =clk_fixed ("ref3" ,3 *1000 *1000 ); - clks[clk_ref_1] =clk_fixed ("ref1" ,1 *1000 *1000 ); +struct clk *clk; - ret =clk_register_clkdev (clks[dummy],"apb_pclk" ,NULL ); -if (ret) - goto clk_err; + clk =clk_fixed ("apb_pclk" ,0 ); +clk_register_clkdev (clk,"apb_pclk" ,NULL ); - ret =clk_register_clkdev (clks[clk_ref_3],NULL ,"uart0-pl0110" ); -if (ret) - goto clk_err; + clk =clk_fixed ("uart0-pl0110" ,3 *1000 *1000 ); +clk_register_clkdev (clk,NULL ,"uart0-pl0110" ); - ret =clk_register_clkdev (clks[clk_ref_1],NULL ,"bcm2835-cs" ); -if (ret) - goto clk_err; + clk =clk_fixed ("bcm2835-cs" ,1 *1000 *1000 ); +clk_register_clkdev (clk,NULL ,"bcm2835-cs" );return 0 ; - -clk_err: -return ret; - }postcore_initcall (bcm2835_clk_init);
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 5/10 ARM: bcm2835: register the clocksource driver earlier
In reply to Andre HeiderRPi's mailbox driver is used early and it needs clock functions to handle timeouts.
Promote to a core_initcall().
--- drivers/clocksource/bcm2835.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/bcm2835.c +1 -1
@@ -87,4 +87,4 @@ static int bcm2835_cs_init(void) {return platform_driver_register (&bcm2835_cs_driver); } -coredevice_initcall (bcm2835_cs_init); +core_initcall (bcm2835_cs_init);
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 6/10 ARM: bcm2835: register the clocksource device earlier
In reply to Andre HeiderRPi's mailbox driver is used early and it needs clock functions to handle timeouts.
Register the driver straight after its clkdev.
--- arch/arm/mach-bcm2835/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-bcm2835/core.c +2 -1
@@ -45,6 +45,8 @@ static int bcm2835_clk_init(void) clk =clk_fixed ("bcm2835-cs" ,1 *1000 *1000 );clk_register_clkdev (clk,NULL ,"bcm2835-cs" ); +add_generic_device ("bcm2835-cs" ,DEVICE_ID_SINGLE ,NULL ,BCM2835_ST_BASE ,0x1C ,IORESOURCE_MEM ,NULL ); +return 0 ; }postcore_initcall (bcm2835_clk_init);
@@ -52,7 +54,6 @@ postcore_initcall(bcm2835_clk_init);static int bcm2835_dev_init (void ) {add_generic_device ("bcm2835-gpio" ,0 ,NULL ,BCM2835_GPIO_BASE ,0xB0 ,IORESOURCE_MEM ,NULL ); -add_generic_device ("bcm2835-cs" ,DEVICE_ID_SINGLE ,NULL ,BCM2835_ST_BASE ,0x1C ,IORESOURCE_MEM ,NULL );add_generic_device ("bcm2835_mci" ,0 ,NULL ,BCM2835_EMMC_BASE ,0xFC ,IORESOURCE_MEM ,NULL );return 0 ; }
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 7/10 ARM: bcm2835: add a mailbox driver for VideoCore
In reply to Andre HeiderThis allows exchanging data with the on-SoC GPU.
Based on U-Boot code by Stephen Warren.
--- arch/arm/mach-bcm2835/Makefile | 2 +- arch/arm/mach-bcm2835/include/mach/mbox.h | 420 ++++++++++++++++++++++++++++++ arch/arm/mach-bcm2835/mbox.c | 152 +++++++++++ 3 files changed, 573 insertions(+), 1 deletion(-) create mode 100644 arch/arm/mach-bcm2835/include/mach/mbox.h create mode 100644 arch/arm/mach-bcm2835/mbox.c
arch/arm/mach-bcm2835/Makefile +1 -1
@@ -1 +1 @@ -obj-y += core.o +obj-y += core.o mbox.o
arch/arm/mach-bcm2835/include/mach/mbox.h new file +420 -0
420 lines not on this page · raw message
arch/arm/mach-bcm2835/mbox.c new file +152 -0
152 lines not on this page · raw message
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 8/10 ARM: rpi: register a clkdev for the eMMC clock
In reply to Andre HeiderUse the mailbox driver to query the clock frequency and create a clkdev for the bcm2835_mci driver.
--- arch/arm/boards/raspberry-pi/rpi.c | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+)
arch/arm/boards/raspberry-pi/rpi.c +40 -0
@@ -17,11 +17,44 @@#include <init.h> #include <fs.h> #include <linux/stat.h> +#include <linux/clk.h> +#include <linux/clkdev.h> #include <envfs.h> #include <asm/armlinux.h> #include <generated/mach-types.h> #include <mach/core.h> +#include <mach/mbox.h> + +struct msg_get_clock_rate { +struct bcm2835_mbox_hdr hdr; +struct bcm2835_mbox_tag_get_clock_rate get_clock_rate; +u32 end_tag; +}; + +static int rpi_register_clkdev (u32 clock_id,const char *name) +{ + BCM2835_MBOX_STACK_ALIGN(struct msg_get_clock_rate, msg); +struct clk *clk; +int ret; + +BCM2835_MBOX_INIT_HDR (msg); +BCM2835_MBOX_INIT_TAG (&msg->get_clock_rate,GET_CLOCK_RATE ); + msg->get_clock_rate.body.req.clock_id = clock_id; + + ret =bcm2835_mbox_call_prop (BCM2835_MBOX_PROP_CHAN , &msg->hdr); +if (ret) +return ret; + + clk =clk_fixed (name, msg->get_clock_rate.body.resp.rate_hz); +if (IS_ERR (clk)) +return PTR_ERR (clk); + +if (!clk_register_clkdev (clk,NULL , name)) +return -ENODEV ; + +return 0 ; +}static int rpi_mem_init (void ) {
@@ -40,6 +73,13 @@ static int rpi_console_init(void) }console_initcall (rpi_console_init); +static int rpi_clock_init (void ) +{ +rpi_register_clkdev (BCM2835_MBOX_CLOCK_ID_EMMC ,"bcm2835_mci0" ); +return 0 ; +} +postconsole_initcall (rpi_clock_init); +static int rpi_env_init (void ) {struct stat s;
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 9/10 mci: bcm2835: use the registered device clkdev
In reply to Andre HeiderSwitch from local mailbox code to using the newly created clock device.
--- drivers/mci/mci-bcm2835.c | 93 ++++++++++------------------------------------- drivers/mci/mci-bcm2835.h | 48 ------------------------ 2 files changed, 19 insertions(+), 122 deletions(-)
drivers/mci/mci-bcm2835.c +19 -74
@@ -28,13 +28,14 @@* Author: Wilhelm Lundgren <[email protected]> */ -#include <asm/mmu.h> #include <common.h> #include <init.h> #include <mci.h> #include <io.h> #include <malloc.h> #include <clock.h> +#include <linux/clk.h> +#include "mci-bcm2835.h" #include "sdhci.h"
@@ -469,53 +470,6 @@ int bcm2835_mci_reset(struct mci_host *mci, struct device_d *mci_dev)return bcm2835_mci_wait_command_done (host); } -static u32 bcm2835_mci_get_emmc_clock (struct msg_get_clock_rate *clk_data) -{ -u32 val; -struct bcm2835_mbox_regs __iomem *regs = - (struct bcm2835_mbox_regs *)BCM2835_MBOX_PHYSADDR ; - -/*Read out old msg*/ -while (true) { - val =readl (®s->status); -if (val &BCM2835_MBOX_STATUS_RD_EMPTY ) -break ; - val =readl (®s->read); - } - -/*Check for ok to write*/ -while (true) { - val =readl (®s->status); -if (!(val &BCM2835_MBOX_STATUS_WR_FULL )) -break ; - } - val =BCM2835_MBOX_PROP_CHAN + ((u32) &clk_data->hdr); -dma_flush_range ((u32 )clk_data, (u32 )clk_data +sizeof (*clk_data)); -writel (val, ®s->write); - -while (true) { -/* Wait for the response */ -while (true) { - val =readl (®s->status); -if (!(val &BCM2835_MBOX_STATUS_RD_EMPTY )) -break ; - } - -/* Read the response */ - val =readl (®s->read); -if ((val &0x0F ) ==BCM2835_MBOX_PROP_CHAN ) -break ; - } - -dma_inv_range ((u32 )clk_data, (u32 )clk_data +sizeof (*clk_data)); - -if ((val & ~0x0F ) == ((u32) &clk_data->hdr)) -if (clk_data->get_clock_rate.tag_hdr.val_len - &BCM2835_MBOX_TAG_VAL_LEN_RESPONSE ) -return 1 ; -return 0 ; -} -static int bcm2835_mci_detect (struct device_d *dev) {struct bcm2835_mci_host *host = dev->priv;
@@ -526,7 +480,22 @@ static int bcm2835_mci_detect(struct device_d *dev)static int bcm2835_mci_probe (struct device_d *hw_dev) {struct bcm2835_mci_host *host; -struct msg_get_clock_rate *clk_data; +static struct clk *clk; +int ret; + + clk =clk_get (hw_dev,NULL ); +if (IS_ERR (clk)) { + ret =PTR_ERR (clk); +dev_err (hw_dev,"clock not found: %d\n" , ret); +return ret; + } + + ret =clk_enable (clk); +if (ret) { +dev_err (hw_dev,"clock failed to enable: %d\n" , ret); +clk_put (clk); +return ret; + } host =xzalloc (sizeof (*host)); host->mci.send_cmd = bcm2835_mci_request;
@@ -534,31 +503,7 @@ static int bcm2835_mci_probe(struct device_d *hw_dev) host->mci.init = bcm2835_mci_reset; host->mci.hw_dev = hw_dev; host->hw_dev = hw_dev; - -/* Allocate a buffer thats 16 bytes aligned in memory -* Of the 32 bits address passed into the mbox 28 bits -* are the address of the buffer, lower 4 bits is channel -*/ - clk_data =memalign (16 ,sizeof (struct msg_get_clock_rate )); -memset (clk_data,0 ,sizeof (struct msg_get_clock_rate )); - clk_data->hdr.buf_size =sizeof (struct msg_get_clock_rate ); - clk_data->get_clock_rate.tag_hdr.tag =BCM2835_MBOX_TAG_GET_CLOCK_RATE ; - clk_data->get_clock_rate.tag_hdr.val_buf_size = -sizeof (clk_data->get_clock_rate.body); - clk_data->get_clock_rate.tag_hdr.val_len = -sizeof (clk_data->get_clock_rate.body.req); - clk_data->get_clock_rate.body.req.clock_id =BCM2835_MBOX_CLOCK_ID_EMMC ; - -if (!bcm2835_mci_get_emmc_clock (clk_data)) { -dev_warn (host->hw_dev, -"Failed getting emmc clock, lets go anyway with 50MHz\n" ); - host->max_clock =50000000 ; - }else { - host->max_clock = clk_data->get_clock_rate.body.resp.rate_hz; -dev_info (host->hw_dev,"Got emmc clock at %d Hz\n" , - host->max_clock); - } - + host->max_clock =clk_get_rate (clk); host->regs =dev_request_mem_region (hw_dev,0 );if (host->regs ==NULL ) {dev_err (host->hw_dev,"Failed request mem region, aborting...\n" );
drivers/mci/mci-bcm2835.h +0 -48
51 lines not on this page · raw message
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 10/10 ARM: rpi: use the proper ARM memory size
In reply to Andre HeiderUse the mailbox driver to query the size. This properly takes the firmware's VideoCore/ARM memory split into account.
Linux can now be booted with more than 128 MiB.
--- arch/arm/boards/raspberry-pi/rpi.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-)
arch/arm/boards/raspberry-pi/rpi.c +33 -2
@@ -26,12 +26,35 @@#include <mach/core.h> #include <mach/mbox.h> +struct msg_get_arm_mem { +struct bcm2835_mbox_hdr hdr; +struct bcm2835_mbox_tag_get_arm_mem get_arm_mem; +u32 end_tag; +}; +struct msg_get_clock_rate {struct bcm2835_mbox_hdr hdr;struct bcm2835_mbox_tag_get_clock_rate get_clock_rate;u32 end_tag; }; +static int rpi_get_arm_mem (u32 *size) +{ + BCM2835_MBOX_STACK_ALIGN(struct msg_get_arm_mem, msg); +int ret; + +BCM2835_MBOX_INIT_HDR (msg); +BCM2835_MBOX_INIT_TAG (&msg->get_arm_mem,GET_ARM_MEMORY ); + + ret =bcm2835_mbox_call_prop (BCM2835_MBOX_PROP_CHAN , &msg->hdr); +if (ret) +return ret; + + *size = msg->get_arm_mem.body.resp.mem_size; + +return 0 ; +} +static int rpi_register_clkdev (u32 clock_id,const char *name) { BCM2835_MBOX_STACK_ALIGN(struct msg_get_clock_rate, msg);
@@ -58,8 +81,16 @@ static int rpi_register_clkdev(u32 clock_id, const char *name)static int rpi_mem_init (void ) { -bcm2835_add_device_sdram (0 ); -return 0 ; +u32 size =0 ; +int ret; + + ret =rpi_get_arm_mem (&size); +if (ret) +printf ("could not query ARM memory size\n" ); + +bcm2835_add_device_sdram (size); + +return ret; }mem_initcall (rpi_mem_init);
Signature · 7 lines
1.8.3.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Hi Andre,
Quoted 17 lines · Andre Heider
This adds a bcm2835 mailbox driver for the RPi to talk to the on-SoC VideoCore. See [1] for a description.
This patchset uses it to get two properties, the eMMC clock and the memory size.
The RPi backend needs to use this driver early on, namely before the MMU setup. We also want to use the driver in the future after the MMU setup, like setting up simplefb for the kernel. Patch 1 and 2 lay the groundwork for that.
The mailbox driver also needs to handle timouts, so patch 5 and 6 are making the clocksource accessible earlier.
Patch 7 is the driver itself, providing a helper macro for users based on a new common macro from patch 3.
Quoted 6 lines
Patch 8 and 9 switch the
bc2835_mcidriver from a local mailbox implementation to the new driver.Patch 10 uses the driver to get the proper memory size.
Patch 4 is just a cleanup.
I'm in Edinburgh this week and won't have much time. I'll have a loser look next week. This series isn't lost. Thanks for working on this.
Sascha
Signature · 9 lines
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 [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 23 lines · Sascha Hauer
Hi Andre,
Quoted 20 lines · Andre Heider
This adds a bcm2835 mailbox driver for the RPi to talk to the on-SoC VideoCore. See [1] for a description.
This patchset uses it to get two properties, the eMMC clock and the memory size.
The RPi backend needs to use this driver early on, namely before the MMU setup. We also want to use the driver in the future after the MMU setup, like setting up simplefb for the kernel. Patch 1 and 2 lay the groundwork for that.
The mailbox driver also needs to handle timouts, so patch 5 and 6 are making the clocksource accessible earlier.
Patch 7 is the driver itself, providing a helper macro for users based on a new common macro from patch 3.
Patch 8 and 9 switch the
bc2835_mcidriver from a local mailbox implementation to the new driver.
Quoted 6 lines
Quoted 3 lines
Patch 10 uses the driver to get the proper memory size.
Patch 4 is just a cleanup.
I'm in Edinburgh this week and won't have much time. I'll have a loser look next week. This series isn't lost. Thanks for working on this.
No worries, there's no need to rush :)
Regards,
Andre
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 17 lines · Andre Heider
This adds a bcm2835 mailbox driver for the RPi to talk to the on-SoC VideoCore. See [1] for a description.
This patchset uses it to get two properties, the eMMC clock and the memory size.
The RPi backend needs to use this driver early on, namely before the MMU setup. We also want to use the driver in the future after the MMU setup, like setting up simplefb for the kernel. Patch 1 and 2 lay the groundwork for that.
The mailbox driver also needs to handle timouts, so patch 5 and 6 are making the clocksource accessible earlier.
Patch 7 is the driver itself, providing a helper macro for users based on a new common macro from patch 3.
Quoted 6 lines
Patch 8 and 9 switch the
bc2835_mcidriver from a local mailbox implementation to the new driver.Patch 10 uses the driver to get the proper memory size.
Patch 4 is just a cleanup.
Applied, thanks. I'll probably have a closer look at the caching bits later, but looks good for now.
Sascha
Signature · 9 lines
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 [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Quoted 21 lines · Sascha Hauer
Quoted 20 lines · Andre Heider
This adds a bcm2835 mailbox driver for the RPi to talk to the on-SoC VideoCore. See [1] for a description.
This patchset uses it to get two properties, the eMMC clock and the memory size.
The RPi backend needs to use this driver early on, namely before the MMU setup. We also want to use the driver in the future after the MMU setup, like setting up simplefb for the kernel. Patch 1 and 2 lay the groundwork for that.
The mailbox driver also needs to handle timouts, so patch 5 and 6 are making the clocksource accessible earlier.
Patch 7 is the driver itself, providing a helper macro for users based on a new common macro from patch 3.
Patch 8 and 9 switch the
bc2835_mcidriver from a local mailbox implementation to the new driver.
Quoted 6 lines
Quoted 3 lines
Patch 10 uses the driver to get the proper memory size.
Patch 4 is just a cleanup.
Applied, thanks. I'll probably have a closer look at the caching bits later, but looks good for now.
Thanks Sascha!
Any particular concerns about the caching bits?
Regards,
Andre
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Quoted 24 lines · Andre Heider
Quoted 23 lines · Sascha Hauer
Quoted 22 lines · Andre Heider
This adds a bcm2835 mailbox driver for the RPi to talk to the on-SoC VideoCore. See [1] for a description.
This patchset uses it to get two properties, the eMMC clock and the memory size.
The RPi backend needs to use this driver early on, namely before the MMU setup. We also want to use the driver in the future after the MMU setup, like setting up simplefb for the kernel. Patch 1 and 2 lay the groundwork for that.
The mailbox driver also needs to handle timouts, so patch 5 and 6 are making the clocksource accessible earlier.
Patch 7 is the driver itself, providing a helper macro for users based on a new common macro from patch 3.
Patch 8 and 9 switch the
bc2835_mcidriver from a local mailbox implementation to the new driver.Patch 10 uses the driver to get the proper memory size.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Patch 4 is just a cleanup.
Applied, thanks. I'll probably have a closer look at the caching bits later, but looks good for now.
Thanks Sascha!
Any particular concerns about the caching bits?
I'm concerned about "only invalidate caches if we have functions to do so". This could lead to some quiet bugs when we really ought to invalidate caches but missed to setup the functions early enough.
Sascha
Signature · 9 lines
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 [email protected] http://lists.infradead.org/mailman/listinfo/barebox