blob: 4d5f654868ee006c5bc5ead4cc867ee8b2254880 [file] [log] [blame]
Angel Pons5f249e62020-04-04 18:51:01 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Patrick Rudolph71c0a942019-01-02 13:52:51 +01002
3#include <device/device.h>
4#include <soc/uart.h>
5#include <device/pci.h>
6#include <device/pci_ids.h>
7
8static 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
18static struct device_operations device_ops = {
19 .init = cavium_uart_init,
20};
21
22static 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älkki08c76e12019-08-25 13:05:46 +030027
28struct chip_operations soc_cavium_common_pci_ops = {
29 CHIP_NAME("Cavium ThunderX UART")
30};