A new PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE quirk and smp initialization callbacks for omap5
cover A new PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE quirk and smp initialization callbacks for omap5
This series contains the work I've mentioned in the previous mail. It is still under development. I plan to re-ship it after I boot the dom0 kernel successfully again on my OMAP5 board. So this is just supplement information for the last mail.
Chen Baozi (3):
xen/arm: fix a typo in comment of PLATFORM_QUIRK_DOM0_MAPPING_11 xen/arm: Add PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE xen/arm: implement smp initialization callbacks for omap5
xen/arch/arm/domain_build.c | 3 ++- xen/arch/arm/platforms/omap5.c | 37 ++++++++++++++++++++++++++++++++++- xen/include/asm-arm/platform.h | 8 +++++++- xen/include/asm-arm/platforms/omap5.h | 3 +++ 4 files changed, 48 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.1.4
PATCH 1/3 xen/arm: fix a typo in comment of PLATFORM_QUIRK_DOM0_MAPPING_11
--- xen/include/asm-arm/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/asm-arm/platform.h +1 -1
@@ -41,7 +41,7 @@ struct platform_desc {/* * Quirk to map dom0 memory in 1:1 -* Usefull on platform where System MMU is not yet implemented +* Useful on platform where System MMU is not yet implemented */ #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
Signature · 1 line
1.8.1.4
Re: [PATCH 1/3] xen/arm: fix a typo in comment of PLATFORM_QUIRK_DOM0_MAPPING_11
(+ Ian Campbell in CC)
Quoted 2 lines · Chen Baozi
Signed-off-by Chen Baozi <[email protected]>
If you don't mind, I think this patch can go upstream :).
Quoted 18 lines
--- xen/include/asm-arm/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)xen/include/asm-arm/platform.h +1
-1@@ -41,7 +41,7 @@ struct platform_desc {/* * Quirk to map dom0 memory in 1:1 -* Usefull on platform where System MMU is not yet implemented +* Useful on platform where System MMU is not yet implemented */ #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)
Signature · 1 line
Julien Grall
Re: [PATCH 1/3] xen/arm: fix a typo in comment of PLATFORM_QUIRK_DOM0_MAPPING_11
Quoted 7 lines · Julien Grall
(+ Ian Campbell in CC)
Quoted 2 lines · Chen Baozi
Signed-off-by Chen Baozi <[email protected]>If you don't mind, I think this patch can go upstream :).
Never mind, ;-)
Quoted 24 lines
Acked-by Julien Grall <[email protected]>Quoted 18 lines
--- xen/include/asm-arm/platform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)xen/include/asm-arm/platform.h +1
-1@@ -41,7 +41,7 @@ struct platform_desc {/* * Quirk to map dom0 memory in 1:1 -* Usefull on platform where System MMU is not yet implemented +* Useful on platform where System MMU is not yet implemented */ #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0)Signature · 1 line
Julien Grall
Re: [PATCH 1/3] xen/arm: fix a typo in comment of PLATFORM_QUIRK_DOM0_MAPPING_11
In reply to Julien GrallQuoted 9 lines · Julien Grall
(+ Ian Campbell in CC)
Quoted 2 lines · Chen Baozi
Signed-off-by Chen Baozi <[email protected]>If you don't mind, I think this patch can go upstream :).
Acked-by Julien Grall <[email protected]>
Yep. Applied.
PATCH 2/3 xen/arm: Add PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE
In reply to Chen BaoziAdd a new quirk to map all disabled device in dom0, for omap5 kernel would try to access the modules that are listed in DT and then do a soft-reset to get those modules to a known state.
--- xen/arch/arm/domain_build.c | 3 ++- xen/arch/arm/platforms/omap5.c | 3 ++- xen/include/asm-arm/platform.h | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-)
xen/arch/arm/domain_build.c +2 -1
@@ -714,7 +714,8 @@ static int handle_node(struct domain *d, struct kernel_info *kinfo,* solution can be use later for pass through. */ if ( !dt_device_type_is_equal (np,"memory" ) && -dt_device_is_available (np) ) + (dt_device_is_available (np) || +platform_has_quirk (PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE ))) { res =map_device (d, np);
xen/arch/arm/platforms/omap5.c +2 -1
@@ -123,7 +123,8 @@ static int omap5_specific_mapping(struct domain *d)static uint32_t omap5_quirks (void ) { -return PLATFORM_QUIRK_DOM0_MAPPING_11 ; +return PLATFORM_QUIRK_DOM0_MAPPING_11 | +PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE ; } static const char const *omap5_dt_compat[] __initdata =
xen/include/asm-arm/platform.h +6 -0
@@ -44,6 +44,12 @@ struct platform_desc {* Useful on platform where System MMU is not yet implemented */ #define PLATFORM_QUIRK_DOM0_MAPPING_11 (1 << 0) +/* +* Quirk to map disabled device +* Useful on platform where dom0 kernel would access device addresses +* whether it is disabled or not. +*/ +#define PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE (1 << 1)int __init platform_init (void );int __init platform_init_time (void );
Signature · 1 line
1.8.1.4
Re: [PATCH 2/3] xen/arm: Add PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE
Quoted 5 lines · Chen Baozi
Add a new quirk to map all disabled device in dom0, for omap5 kernel would try to access the modules that are listed in DT and then do a soft-reset to get those modules to a known state.
Signed-off-by Chen Baozi <[email protected]>
Are we intending to run with this approach or is the kernel getting fixed?
Re: [PATCH 2/3] xen/arm: Add PLATFORM_QUIRK_DOM0_MAP_DISABLED_DEVICE
Hi Ian,
Sorry for the late reply.
Quoted 9 lines · Ian Campbell
Quoted 5 lines · Chen Baozi
Add a new quirk to map all disabled device in dom0, for omap5 kernel would try to access the modules that are listed in DT and then do a soft-reset to get those modules to a known state.
Signed-off-by Chen Baozi <[email protected]>Are we intending to run with this approach or is the kernel getting fixed?
I prefer to run with this approach. After hacking the dom0 not to initialize UART3's state, I booted dom0 again with this patch finally. I think I could add more hacks to avoid using this patch booting dom0, but I don't think those hacks are neat enough to be merged to mainline kernel.
Cheers,
Baozi
PATCH 3/3 xen/arm: implement smp initialization callbacks for omap5
In reply to Chen Baozi--- xen/arch/arm/platforms/omap5.c | 34 ++++++++++++++++++++++++++++++++++ xen/include/asm-arm/platforms/omap5.h | 3 +++ 2 files changed, 37 insertions(+)
xen/arch/arm/platforms/omap5.c +34 -0
@@ -121,6 +121,38 @@ static int omap5_specific_mapping(struct domain *d)return 0 ; } +static int __init omap5_smp_init (void ) +{ +void __iomem *wugen_base; + + wugen_base =ioremap_nocache (OMAP5_WKUPGEN_BASE ,PAGE_SIZE ); +if ( !wugen_base ) + { +dprintk (XENLOG_ERR ,"Unable to map omap5 MMIO\n" ); +return -EFAULT ; + } + +printk ("Set AuxCoreBoot1 to %" PRIpaddr" (%p)\n" , +__pa (init_secondary), init_secondary); +writel (__pa (init_secondary), wugen_base +OMAP_AUX_CORE_BOOT_1_OFFSET ); + +printk ("Set AuxCoreBoot0 to 0x20\n" ); +writel (0x20 , wugen_base +OMAP_AUX_CORE_BOOT_0_OFFSET ); + +iounmap (wugen_base); + +return 0 ; +} + +static int __init omap5_cpu_up (int cpu) +{ +/* Nothing to do here, the generic sev() will suffice to kick CPUs +* out of either the firmware or our own smp_up_cpu gate, +* depending on where they have ended up. */ + +return 0 ; +} +static uint32_t omap5_quirks (void ) { return PLATFORM_QUIRK_DOM0_MAPPING_11 |
@@ -137,6 +169,8 @@ PLATFORM_START(omap5, "TI OMAP5") .compatible = omap5_dt_compat, .init_time = omap5_init_time, .specific_mapping = omap5_specific_mapping, + .smp_init = omap5_smp_init, + .cpu_up = omap5_cpu_up, .quirks = omap5_quirks,PLATFORM_END
xen/include/asm-arm/platforms/omap5.h +3 -0
@@ -17,6 +17,9 @@#define OMAP5_WKUPGEN_BASE 0x48281000#define OMAP5_SRAM_PA 0x40300000 +#define OMAP_AUX_CORE_BOOT_0_OFFSET 0x800 +#define OMAP_AUX_CORE_BOOT_1_OFFSET 0x804 +#endif /* __ASM_ARM_PLATFORMS_OMAP5_H */ /*
Signature · 1 line
1.8.1.4
Re: [PATCH 3/3] xen/arm: implement smp initialization callbacks for omap5
Quoted 2 lines · Chen Baozi
Signed-off-by Chen Baozi <[email protected]>
If you don't modify the patch in the next version:
Quoted 72 lines
--- xen/arch/arm/platforms/omap5.c | 34 ++++++++++++++++++++++++++++++++++ xen/include/asm-arm/platforms/omap5.h | 3 +++ 2 files changed, 37 insertions(+)xen/arch/arm/platforms/omap5.c +34
-0@@ -121,6 +121,38 @@ static int omap5_specific_mapping(struct domain *d)return 0 ; } +static int __init omap5_smp_init (void ) +{ +void __iomem *wugen_base; + + wugen_base =ioremap_nocache (OMAP5_WKUPGEN_BASE ,PAGE_SIZE ); +if ( !wugen_base ) + { +dprintk (XENLOG_ERR ,"Unable to map omap5 MMIO\n" ); +return -EFAULT ; + } + +printk ("Set AuxCoreBoot1 to %" PRIpaddr" (%p)\n" , +__pa (init_secondary), init_secondary); +writel (__pa (init_secondary), wugen_base +OMAP_AUX_CORE_BOOT_1_OFFSET ); + +printk ("Set AuxCoreBoot0 to 0x20\n" ); +writel (0x20 , wugen_base +OMAP_AUX_CORE_BOOT_0_OFFSET ); + +iounmap (wugen_base); + +return 0 ; +} + +static int __init omap5_cpu_up (int cpu) +{ +/* Nothing to do here, the generic sev() will suffice to kick CPUs +* out of either the firmware or our own smp_up_cpu gate, +* depending on where they have ended up. */ + +return 0 ; +} +static uint32_t omap5_quirks (void ) { return PLATFORM_QUIRK_DOM0_MAPPING_11 |@@ -137,6 +169,8 @@ PLATFORM_START(omap5, "TI OMAP5") .compatible = omap5_dt_compat, .init_time = omap5_init_time, .specific_mapping = omap5_specific_mapping, + .smp_init = omap5_smp_init, + .cpu_up = omap5_cpu_up, .quirks = omap5_quirks,PLATFORM_END xen/include/asm-arm/platforms/omap5.h +3
-0@@ -17,6 +17,9 @@#define OMAP5_WKUPGEN_BASE 0x48281000#define OMAP5_SRAM_PA 0x40300000 +#define OMAP_AUX_CORE_BOOT_0_OFFSET 0x800 +#define OMAP_AUX_CORE_BOOT_1_OFFSET 0x804 +#endif /* __ASM_ARM_PLATFORMS_OMAP5_H */ /*
Signature · 1 line
Julien Grall
Ian Campbell
AppliedRe: [PATCH 3/3] xen/arm: implement smp initialization callbacks for omap5
Quoted 8 lines · Julien Grall
Quoted 2 lines · Chen Baozi
Signed-off-by Chen Baozi <[email protected]>If you don't modify the patch in the next version:
Acked-by Julien Grall <[email protected]>
Applied.