[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC] DRA7: Add specific mappings for devices/regions not in the device tree.



On Wed, 2015-07-29 at 16:53 -0400, Brandon Perez wrote:
> The DRA7 chip, which is similar to the OMAP5 chip, also requires specific
> mappings. These are MMIO mappings which are not explicitly stated in the 
> device
> tree, so Xen does not know to map them. This patch adds these regions required
> by the DRA7 to be mapped.

I suppose the chances of getting this fixed in the DTS is slim?

> Signed-off-by: Brandon Perez <bperez-1@xxxxxx>
> ---
>  xen/arch/arm/platforms/omap5.c        |   27 +++++++++++++++++++++++++++
>  xen/include/asm-arm/platforms/omap5.h |    3 +++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/xen/arch/arm/platforms/omap5.c 
> b/xen/arch/arm/platforms/omap5.c
> index e7bf30d..3c6495a 100644
> --- a/xen/arch/arm/platforms/omap5.c
> +++ b/xen/arch/arm/platforms/omap5.c
> @@ -120,6 +120,32 @@ static int omap5_specific_mapping(struct domain *d)
>      return 0;
>  }
> 
> +/* Additional mappings for dom0 (not in the DTS) */
> +static int dra7_specific_mapping(struct domain *d)
> +{
> +    /* Map the PRM module */
> +    map_mmio_regions(d, paddr_to_pfn(OMAP5_PRM_BASE), 2,
> +                     paddr_to_pfn(OMAP5_PRM_BASE));
> +
> +    /* Map the PRM_MPU */
> +    map_mmio_regions(d, paddr_to_pfn(OMAP5_PRCM_MPU_BASE), 1,
> +                     paddr_to_pfn(OMAP5_PRCM_MPU_BASE));
> +
> +    /* Map the Wakeup Gen */
> +    map_mmio_regions(d, paddr_to_pfn(OMAP5_WKUPGEN_BASE), 1,
> +                     paddr_to_pfn(OMAP5_WKUPGEN_BASE));
> +
> +    /* Map the on-chip SRAM */
> +    map_mmio_regions(d, paddr_to_pfn(OMAP5_SRAM_PA), 32,
> +                     paddr_to_pfn(OMAP5_SRAM_PA));
> +
> +    /* Map GPMC address space for NAND flash. */
> +    map_mmio_regions(d, paddr_to_pfn(OMAP5_GPMC_PA), 65536,
> +                     paddr_to_pfn(OMAP5_GPMC_PA));

This is basically the same as the omap5 one, plus an extra GPMC mapping.

I'm unsure about the relationship between omap5 and the DRA7, is it the
case that there is some common core which both omap5 and dra7 derive from?
Or maybe dra7 derives from omap5?

If there is some commonality I'd prefer to see a common function, used from
both.

So depending on the "lineage" either omap5_common_specific_mapping, called
by both omap5_specific_mapping and dra7_specific_mapping (if they have a
common core) or dri7_specific_mapping just calling omap5_specific_mapping
(if dra7 is a derivative of omap5).

Of course if the GPMC is also present on omap5 then we should just add the
specific mapping there and call the existing function for dra7 too.

> +
> +    return 0;
> +}
> +
>  static int __init omap5_smp_init(void)
>  {
>      void __iomem *wugen_base;
> @@ -171,6 +197,7 @@ PLATFORM_START(dra7, "TI DRA7")
>      .init_time = omap5_init_time,
>      .cpu_up = cpu_up_send_sgi,
>      .smp_init = omap5_smp_init,
> +    .specific_mapping = dra7_specific_mapping,
> 
>      .dom0_gnttab_start = 0x4b000000,
>      .dom0_gnttab_size = 0x20000,
> diff --git a/xen/include/asm-arm/platforms/omap5.h b/xen/include/asm
> -arm/platforms/omap5.h
> index c559c84..d87e7d2 100644
> --- a/xen/include/asm-arm/platforms/omap5.h
> +++ b/xen/include/asm-arm/platforms/omap5.h
> @@ -20,6 +20,9 @@
>  #define OMAP_AUX_CORE_BOOT_0_OFFSET             0x800
>  #define OMAP_AUX_CORE_BOOT_1_OFFSET             0x804
> 
> +#define OMAP5_GPMC_PA                           0x01000000
> +#define OMAP5_TILER_PA                          0x60000000

TILER_PA is unused, did you miss it or is this #define unneeded?

I'd really like to see us moving away from xen/include/asm
-arm/platforms/*.h to adding the definitions locally to
xen/arch/arm/platforms/*.c, since the way things are since Xen 4.5 nothing
outside the .c file should need those definitions any longer.

I don't suppose you fancy tackling that for the omap case as a precursor to
this series do you?

> +
>  #endif /* __ASM_ARM_PLATFORMS_OMAP5_H */
> 
>  /*
> --
> 1.7.9.5
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.