-
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 16550 compatible PCI serial cards #13393
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raiden00pl
added
Type: Enhancement
New feature or request
breaking change
This change requires a mitigation entry in the release notes.
labels
Sep 12, 2024
szafonimateusz-mi
force-pushed
the
pci_serial
branch
from
September 12, 2024 09:36
90f3f18
to
3f27f18
Compare
szafonimateusz-mi
force-pushed
the
pci_serial
branch
from
September 12, 2024 09:39
3f27f18
to
f5563fb
Compare
@ldube FYI since it seems you are using a device with 16550 UART |
szafonimateusz-mi
force-pushed
the
pci_serial
branch
from
September 12, 2024 14:22
f5563fb
to
4ea2b92
Compare
raiden00pl
force-pushed
the
pci_serial
branch
from
September 13, 2024 06:56
4ea2b92
to
d5a195e
Compare
szafonimateusz-mi
force-pushed
the
pci_serial
branch
4 times, most recently
from
September 13, 2024 09:54
f30e357
to
763b0b6
Compare
tested on qemu and real HW, it's ready to review |
szafonimateusz-mi
force-pushed
the
pci_serial
branch
from
September 13, 2024 10:00
763b0b6
to
923e7e5
Compare
ldube
reviewed
Sep 13, 2024
ldube
reviewed
Sep 13, 2024
so driver writer could save the private data here and get it back in the probe function. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
initialize ret to avoid compiler warnings in pci_drivers.c Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
szafonimateusz-mi
force-pushed
the
pci_serial
branch
2 times, most recently
from
September 13, 2024 14:59
a958c18
to
49d7dfd
Compare
Some of PCI drivers require OS interfaces that can't be executed in the INIT context. In that case we have to postpone PCI drivers probing and call it for example in board initialization logic. Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
move MCR_OUT2 configuration from qemu-intel64/src/qemu_boot.c to common code also leave this option disabled for qemu-intel64 as it's not required Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
prepare 16550 UART driver to support PCI: - [breaking change] change argument of uart_ioctl() from `struct file *filep` to `FAR struct u16550_s *priv` Also fix moxart_16550.c build related to this change - [breaking change] change argument of uart_getreg() and uart_putreg from `uart_addrwidth_t base` to `FAR struct u16550_s *priv` Also fix arch/x86/src/qemu/qemu_serial.c and arch/x86_64/src/intel64/intel64_serial.c related to this change - [breaking change] change argument of uart_dmachan() from `uart_addrwidth_t base` to `FAR struct u16550_s *priv` - move `struct u16550_s` to public header - generalize UART_XXX_OFFSET so we can use it with any register increment - make u16550_bind(), u16550_interrupt(), u16550_interrupt() public - remove arch/or1k/src/common/or1k_uart.c and use common 16550 MIMO interfacve - change irq type in `struct u16550_s` from uint8_t to int to match MSI API Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
add support for UART 16550 compatible PCI device. For now we support qemu serial PCI devices and AX99100 based cards. Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
intel64 can work with PCI serial cards now Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
add configs with PCI serial console for qemu-intel64 so we can run NuttX on bare metal Intel HW with serial port card Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
fix gcc14 errors for PCI Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
raiden00pl
force-pushed
the
pci_serial
branch
from
September 14, 2024 06:35
49d7dfd
to
2e2a4df
Compare
lupyuen
approved these changes
Sep 14, 2024
xiaoxiang781216
approved these changes
Sep 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
This change requires a mitigation entry in the release notes.
Type: Enhancement
New feature or request
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
drivers: prepare 16550 UART driver to support PCI
prepare 16550 UART driver to support PCI:
[breaking change] change argument of
uart_ioctl()
fromstruct file *filep
toFAR struct u16550_s *priv
Also fix moxart_16550.c build related to this change
[breaking change] change argument of
uart_getreg()
anduart_putreg()
fromuart_addrwidth_t base
toFAR struct u16550_s *priv
Also fix arch/x86/src/qemu/qemu_serial.c and arch/x86_64/src/intel64/intel64_serial.c related to this change
[breaking change] change argument of
uart_dmachan()
fromuart_addrwidth_t base
toFAR struct u16550_s *priv
move
struct u16550_s
to public headergeneralize UART_XXX_OFFSET so we can use it with any register increment
make
u16550_bind()
,u16550_interrupt()
,u16550_interrupt()
publicremove arch/or1k/src/common/or1k_uart.c and use common 16550 MIMO interfacve
drivers: add UART 16550 compatible PCI device support
add support for UART 16550 compatible PCI device
arch/intel64: add support for PCI serial
boards/x86_64/qemu-intel64: add configs with PCI serial console
add configs with PCI serial console for qemu-intel64 so we can run NuttX on bare
metal Intel HW with serial port card
drivers: fix gcc14 errors for PCI
[DONE] Depends on #13391
Impact
out of tree arch that use UART 16550 may need to update interfaces used according to these changes:
change argument of uart_ioctl() from
struct file *filep
toFAR struct u16550_s *priv
look at moxart_16550.c modifed in this PR
change argument of uart_getreg() and uart_putreg from
uart_addrwidth_t base
toFAR struct u16550_s *priv
look at arch/x86/src/qemu/qemu_serial.c and arch/x86_64/src/intel64/intel64_serial.c modifed in this PR
change argument of uart_dmachan() from
uart_addrwidth_t base
toFAR struct u16550_s *priv
uart_dmachan()
not used in upstream.Testing
tested on intel HW with serial PCI card and tested on qemu with command: