-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add support for the BCM2711 #15188
base: master
Are you sure you want to change the base?
Add support for the BCM2711 #15188
Conversation
…ich selected the wrong boot option and caused the binary not to load. This made me lose my mind for at least one hour debugging.
… not sure how to best do that.
…'----' of NSH before shell is unresponsive.
It is going to take me a while to squash all these commits |
Hi @linguini1 I suggest you to squash in a way that the mental logic you used to get this port working be preserved. You can use squash the commits that created the headers files and the commits that fix them. Then they will appear early as an initial commit. Preserving it will be useful to help other people to do the port to other chips. @xiaoxiang781216 what do you think? |
} | ||
|
||
bcm2711_miniuart_wait_send(dev, ch); | ||
#endif // CONSOLE_DEV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove // CONSOLE_DEV
or switch to /* ... */
{ | ||
_err("Could not register /dev/console, ret=%d\n", ret); | ||
} | ||
#endif // defined(CONSOLE_DEV) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove // ...
or switch to /* ... */
|
||
#ifndef __ASSEMBLY__ | ||
|
||
#endif // __ASSEMBLY__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove // ...
or switch to /* ... */
|
||
#endif // __ASSEMBLY__ | ||
|
||
#endif // __ARCH_ARM64_SRC_BCM2711_BCM2711_SERIAL_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
|
||
#define BCM_ARMT_PREDIV_PREDIV (0x3ff << 0) | ||
|
||
#endif // __ARCH_ARM64_SRC_BCM2711_ARMTIMER_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove // ...
or switch to /* ... */
|
||
static struct bcm2711_gpio_dev_s g_gpout[BOARD_NGPIOOUT]; | ||
|
||
#endif // BOARD_NGPIOOUT > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove // ...
or switch to /* ... */
|
||
static struct bcm2711_gpio_dev_s g_gpin[BOARD_NGPIOIN]; | ||
|
||
#endif // BOARD_NGPIOIN > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove // ...
or switch to /* ... */
|
||
static struct bcm2711_gpioint_dev_s g_gpint[BOARD_NGPIOINT]; | ||
|
||
#endif // BOARD_NGPIOINT > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove // ...
or switch to /* ... */
return 0; | ||
} | ||
|
||
#endif // BOARD_NGPIOOUT > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove // ...
or switch to /* ... */
return 0; | ||
} | ||
|
||
#endif // BOARD_NGPIOIN > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove // ...
or switch to /* ... */
@@ -80,4 +82,6 @@ SAVEMake.defs | |||
SAVEconfig | |||
.aider* | |||
imx9-norimage.img | |||
|
|||
config.txt | |||
tools/bcm2711/*.dat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to tools/bcm2711/.gitignore
@@ -352,6 +366,7 @@ config ARM64_DECODEFIQ | |||
config ARM64_GIC_VERSION | |||
int "GIC version" | |||
default 2 if ARCH_CHIP_A64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong alignment, you can move this to the previous line default 2 if ARCH_CHIP_A64 | ARCH_CHIP_BCM2711
#include "chip.h" | ||
#include "hardware/bcm2711_aux.h" | ||
|
||
#define CONFIG_BCM2711_SPI // TODO remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove, we don't need this. It's already protected by if
in Make.defs
Summary
Closes #11586.
This PR adds semi-functional support for the BCM2711 and Raspberry Pi 4B. The working features are a Mini-UART shell which can boot into NSH. I have run OStest and confirmed it works. The latest changes also boot.
Impact
Although the feature implementation for this board is minimal right now, I hope that by releasing the work I've done so far it is easier for other community members to start adding drivers/features to the board's support on NuttX. Several people were interested in using the Pi 4B with NuttX and it's a reasonably popular development board, so having it fully supported will be an asset.
Testing
Built the documentation, ensured it looks correct.
Built the written code so far, which was tested by:
echo 1 > /dev/gpio23
and checking with a multimeter that the GPIO has gone high, or connecting input to a GPIO and performingcat /dev/gpio23
, etc.OStest results log are attached
ostest-bcm2711.txt