blob: af59e2b9fef03f244440e166fc7fee0d280d2773 [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,
Felix Singer43b7f412022-03-07 04:34:52 +010025 .device = PCI_DID_CAVIUM_THUNDERX_UART,
Patrick Rudolph71c0a942019-01-02 13:52:51 +010026};
Kyösti Mälkki08c76e12019-08-25 13:05:46 +030027
28struct chip_operations soc_cavium_common_pci_ops = {
Nicholas Sudsgaardbfb11be2024-01-30 09:53:46 +090029 .name = "Cavium ThunderX UART",
Kyösti Mälkki08c76e12019-08-25 13:05:46 +030030};