Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XIP_MAIN_BASE seems like redundant/deprecated name, since we have XIP_BASE #2240

Open
d-c-d opened this issue Feb 6, 2025 · 7 comments
Open
Assignees
Milestone

Comments

@d-c-d
Copy link
Contributor

d-c-d commented Feb 6, 2025

It appears that if two variables have the same value there should be guidance as to when each should be used.
There is no XIP_MAIN_BASE for the rp20350, so it would be helpful to document if it is deprecated, or just left around for the bootrom and the rp2040 xip_alias_check_addr function

in src/rp2040/hardware_regs/include/hardware/regs/addressmap.h

#define XIP_BASE _u(0x10000000)
#define XIP_MAIN_BASE _u(0x10000000)
@kilograham kilograham assigned kilograham and matiasilva and unassigned kilograham Feb 6, 2025
@kilograham kilograham added this to the 2.1.1 milestone Feb 6, 2025
@kilograham
Copy link
Contributor

@matiasilva did this change by mistake from RP2040 to RP2350?

@kilograham
Copy link
Contributor

ah actually i guess maybe it was vestigial in RP2040

@lurch
Copy link
Contributor

lurch commented Feb 10, 2025

See also sections 2.2.2 in https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf and https://datasheets.raspberrypi.com/rp2350/rp2350-datasheet.pdf
Interestingly, XIP_MAIN_BASE doesn't appear at all in either PDF.

Although I guess for consistency perhaps it's worth modifying address_mapped.h to use XIP_BASE instead of XIP_MAIN_BASE ?

$ git grep XIP_MAIN_BASE
src/rp2040/hardware_regs/include/hardware/regs/addressmap.h:#define XIP_MAIN_BASE _u(0x10000000)
src/rp2_common/hardware_base/include/hardware/address_mapped.h:    valid_params_if(ADDRESS_ALIAS, rc >= XIP_MAIN_BASE && rc < XIP_NOALLOC_BASE);

@matiasilva
Copy link
Contributor

Internal filtering was added to remove XIP_MAIN0_BASE and XIP_MAIN1_BASE from RP2350, I imagine this was not added for RP2040. If we filter on RP2040, we'd need to replace any usage of it.

@lurch
Copy link
Contributor

lurch commented Feb 13, 2025

If we filter on RP2040, we'd need to replace any usage of it.

Perhaps we'd also need to add a #define XIP_MAIN_BASE XIP_BASE for backwards-compatibility, so that we don't accidentally break any 3rd-party code that might have been using XIP_MAIN_BASE ?

@kilograham
Copy link
Contributor

let's just comment the one in RP2040 to say it is vestigial; i'll take that

@kilograham kilograham assigned kilograham and unassigned matiasilva Feb 13, 2025
@kilograham
Copy link
Contributor

duh, that is auto-generated - i'll move this into a later release

@kilograham kilograham modified the milestones: 2.1.1, 2.2.0 Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants