Angel Pons | 5f249e6 | 2020-04-04 18:51:01 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Patrick Rudolph | 71c0a94 | 2019-01-02 13:52:51 +0100 | [diff] [blame] | 2 | |
| 3 | #include <device/device.h> |
| 4 | #include <soc/uart.h> |
| 5 | #include <device/pci.h> |
| 6 | #include <device/pci_ids.h> |
| 7 | |
| 8 | static void cavium_uart_init(struct device *dev) |
| 9 | { |
| 10 | const u8 fn = PCI_FUNC(dev->path.pci.devfn); |
| 11 | |
| 12 | /* Calling uart_setup with no baudrate will do minimal HW init |
| 13 | * enough for the kernel to not panic */ |
| 14 | if (!uart_is_enabled(fn)) |
| 15 | uart_setup(fn, 0); |
| 16 | } |
| 17 | |
| 18 | static struct device_operations device_ops = { |
| 19 | .init = cavium_uart_init, |
| 20 | }; |
| 21 | |
| 22 | static const struct pci_driver soc_cavium_uart __pci_driver = { |
| 23 | .ops = &device_ops, |
| 24 | .vendor = PCI_VENDOR_CAVIUM, |
| 25 | .device = PCI_DEVICE_ID_CAVIUM_THUNDERX_UART, |
| 26 | }; |
Kyösti Mälkki | 08c76e1 | 2019-08-25 13:05:46 +0300 | [diff] [blame] | 27 | |
| 28 | struct chip_operations soc_cavium_common_pci_ops = { |
| 29 | CHIP_NAME("Cavium ThunderX UART") |
| 30 | }; |