Skip to content

raise kernel load addr and slip stack under kernel on both 32bit and 64bit #8305

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

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

cleverca22
Copy link

@cleverca22 cleverca22 commented Aug 21, 2023

while using circuitpython on a pi-zero, i discovered that the stack code code was broken
32bit was operating in dynamic stack mode, but reporting entirely wrong addresses for things
but i noticed, aarch64 on the broadcom port, puts the stack below the kernel load addr

so i just used kernel_address=0x100000 to change the load addr, for both 32bit and 64bit, raising it up a bit more
and made both 32bit and 64bit both have the stack below the kernel, allowing for the code to be simpler

edit:
confirmed the raspberrypi_zero_w build works on a zero-w
the raspberrypi_zero_w build also partially works on a pi1b, but the usb-hub blocks usb-device mode

the raspberrypi_zero2w build works on the zero2w
but hangs mid-boot on a pi3b (same SoC, but with a usb hub)

the raspberrypi_pi4b build boots on a pi4, but no usb-device or hdmi
repl works in hw uart

@dhalbert dhalbert requested a review from tannewt August 21, 2023 21:08
@RetiredWizard
Copy link

I've tested this on both a Zero W and a Zero 2W and it looks like it fixes #8044 for the Zero. The Zero 2W still has issues with USB activity causing hangs but if you use a terminal over the RX/TX pins, the Zero 2W has been relatively stable. During my testing I didn't see any negative impact from this PR on either Zero or the Zero 2W.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you've updated the broadcom-peripherals library on your fork. Please PR those changes to the adafruit version first and then point this PR to it. (Sorry it is annoying.) IIRC tinyusb also uses the peripheral library for its testing.

@tannewt
Copy link
Member

tannewt commented Aug 25, 2023

I think you want to point to adafruit/broadcom-peripherals@ec10438 since it is derived from the merge commit. (That repo is a little weird.)

@cleverca22
Copy link
Author

cleverca22 commented Aug 25, 2023

that might explain why i had an extra 40 commits in my original pr
edit:
oh, and why broadcom/gen/bcm2835_lpa.h is now missing

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@tannewt tannewt merged commit 2eb62f8 into adafruit:main Aug 28, 2023
@cleverca22 cleverca22 deleted the move-stack branch August 28, 2023 20:11
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

Successfully merging this pull request may close these issues.

3 participants