[PATCH 14/16] arm: rmobile: Support RZ/G2L memory map

Marek Vasut marek.vasut at mailbox.org
Wed Oct 4 17:20:53 CEST 2023


On 10/4/23 15:54, Paul Barker wrote:
> On Wed, Oct 04, 2023 at 02:30:53PM +0200, Marek Vasut wrote:
>> On 10/4/23 11:18, Paul Barker wrote:
>>
>> [...]
>>
>>>>> +static struct mm_region rzg2l_mem_map[RZG2L_NR_REGIONS] = {
>>>>> +	{
>>>>> +		.virt = 0x0UL,
>>>>> +		.phys = 0x0UL,
>>>>> +		.size = 0x40000000UL,
>>>>> +		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
>>>>> +			 PTE_BLOCK_NON_SHARE |
>>>>> +			 PTE_BLOCK_PXN | PTE_BLOCK_UXN
>>>>> +	}, {
>>>>> +		.virt = 0x40000000UL,
>>>>> +		.phys = 0x40000000UL,
>>>>> +		.size = 0x03F00000UL,
>>>>> +		.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
>>>>> +			 PTE_BLOCK_INNER_SHARE
>>>>> +	}, {
>>>>> +		.virt = 0x47E00000UL,
>>>>
>>>> What's this part about ?
>>>
>>> This is copied from the RCar Gen3 memory map.
>>
>> I suspected as much. Please recheck the memory map instead of copy-paste and
>> make sure it is really matching the hardware.
> 
> Sorry, I wasn't specific enough there.
> 
> The addition of an entry at 0x40000000 of size 0x03F00000, followed by a
> gap until 0x47E00000, is coped from R-Car as the way TrustedFirmware and
> OP-TEE use the first 128MiB of system memory is the same. The mappings
> here are due to the software configuration of TrustedFirmware & OP-TEE,
> not due to the hardware.
> 
> The hardware itself has a pretty simple memory map which is shown in the
> commit message. The memory map in this file is complete.
> 
> I have a note in the commit that says "Within the DDR area, the first
> 128 MiB are reserved by TrustedFirmware.", I probably just need to
> expand on why we need the mappings at 0x40000000 and 0x47E00000, instead
> of just using the mapping from 0x48000000 that's in the dtb.

Yes please :)

The better the commit message is, the easier the long term maintenance is.


More information about the U-Boot mailing list