doc: replace @return by Return:
[platform/kernel/u-boot.git] / arch / x86 / include / asm / pci.h
index 56eaa25..1c30b32 100644 (file)
@@ -1,8 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * (C) Copyright 2002
  * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifndef _PCI_I386_H_
 
 #ifndef __ASSEMBLY__
 
-#define DEFINE_PCI_DEVICE_TABLE(_table) \
-       const struct pci_device_id _table[]
-
-struct pci_controller;
-
-void pci_setup_type1(struct pci_controller *hose);
-
 /**
- * board_pci_setup_hose() - Set up the PCI hose
+ * pci_x86_read_config() - Read a configuration value from a device
  *
- * This is called by the common x86 PCI code to set up the PCI controller
- * hose. It may be called when no memory/BSS is available so should just
- * store things in 'hose' and not in BSS variables.
+ * This function can be called before PCI is set up in driver model.
+ *
+ * @bdf:       PCI device address: bus, device and function -see PCI_BDF()
+ * @offset:    Register offset to read
+ * @valuep:    Place to put the returned value
+ * @size:      Access size
+ * Return: 0 if OK, -ve on error
  */
-void board_pci_setup_hose(struct pci_controller *hose);
+int pci_x86_read_config(pci_dev_t bdf, uint offset, ulong *valuep,
+                       enum pci_size_t size);
 
 /**
- * pci_early_init_hose() - Set up PCI host before relocation
+ * pci_bus_write_config() - Write a configuration value to a device
+ *
+ * This function can be called before PCI is set up in driver model.
  *
- * This allocates memory for, sets up and returns the PCI hose. It can be
- * called before relocation. The hose will be stored in gd->hose for
- * later use, but will become invalid one DRAM is available.
+ * @bdf:       PCI device address: bus, device and function -see PCI_BDF()
+ * @offset:    Register offset to write
+ * @value:     Value to write
+ * @size:      Access size
+ * Return: 0 if OK, -ve on error
  */
-int pci_early_init_hose(struct pci_controller **hosep);
-
-int board_pci_pre_scan(struct pci_controller *hose);
-int board_pci_post_scan(struct pci_controller *hose);
+int pci_x86_write_config(pci_dev_t bdf, uint offset, ulong value,
+                        enum pci_size_t size);
 
-/*
- * Simple PCI access routines - these work from either the early PCI hose
- * or the 'real' one, created after U-Boot has memory available
+/**
+ * pci_bus_clrset_config32() - Update a configuration value for a device
+ *
+ * The register at @offset is updated to (oldvalue & ~clr) | set. This function
+ * can be called before PCI is set up in driver model.
+ *
+ * @bdf:       PCI device address: bus, device and function -see PCI_BDF()
+ * @offset:    Register offset to update
+ * @clr:       Bits to clear
+ * @set:       Bits to set
+ * Return: 0 if OK, -ve on error
  */
-unsigned int x86_pci_read_config8(pci_dev_t dev, unsigned where);
-unsigned int x86_pci_read_config16(pci_dev_t dev, unsigned where);
-unsigned int x86_pci_read_config32(pci_dev_t dev, unsigned where);
-
-void x86_pci_write_config8(pci_dev_t dev, unsigned where, unsigned value);
-void x86_pci_write_config16(pci_dev_t dev, unsigned where, unsigned value);
-void x86_pci_write_config32(pci_dev_t dev, unsigned where, unsigned value);
-
-int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset,
-                       ulong *valuep, enum pci_size_t size);
-
-int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
-                        ulong value, enum pci_size_t size);
+int pci_x86_clrset_config(pci_dev_t bdf, uint offset, ulong clr, ulong set,
+                         enum pci_size_t size);
 
 /**
  * Assign IRQ number to a PCI device
@@ -72,11 +68,10 @@ int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
  *
  * @bus:       PCI bus number
  * @device:    PCI device number
- * @func:      PCI function number
  * @irq:       An array of IRQ numbers that are assigned to INTA through
  *             INTD of this PCI device.
  */
-void pci_assign_irqs(int bus, int device, int func, u8 irq[4]);
+void pci_assign_irqs(int bus, int device, u8 irq[4]);
 
 #endif /* __ASSEMBLY__ */