Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3da1b617 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Bjorn Helgaas
Browse files

Merge branch 'pci/lpc'

  - add support for PCI I/O port space that's neither directly accessible
    via CPU in/out instructions nor directly mapped into CPU physical
    memory space (Zhichang Yuan)

  - add support for HiSilicon Hip06/Hip07 LPC I/O space (Zhichang Yuan,
    John Garry)

* pci/lpc:
  MAINTAINERS: Add John Garry as maintainer for HiSilicon LPC driver
  HISI LPC: Add ACPI support
  ACPI / scan: Do not enumerate Indirect IO host children
  ACPI / scan: Rename acpi_is_serial_bus_slave() for more general use
  HISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings
  of: Add missing I/O range exception for indirect-IO devices
  PCI: Apply the new generic I/O management on PCI IO hosts
  PCI: Add fwnode handler as input param of pci_register_io_range()
  PCI: Remove __weak tag from pci_register_io_range()
  lib: Add generic PIO mapping method
parents a5c6ad78 6183d9b3
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
Hisilicon Hip06 Low Pin Count device
  Hisilicon Hip06 SoCs implement a Low Pin Count (LPC) controller, which
  provides I/O access to some legacy ISA devices.
  Hip06 is based on arm64 architecture where there is no I/O space. So, the
  I/O ports here are not CPU addresses, and there is no 'ranges' property in
  LPC device node.

Required properties:
- compatible:  value should be as follows:
	(a) "hisilicon,hip06-lpc"
	(b) "hisilicon,hip07-lpc"
- #address-cells: must be 2 which stick to the ISA/EISA binding doc.
- #size-cells: must be 1 which stick to the ISA/EISA binding doc.
- reg: base memory range where the LPC register set is mapped.

Note:
  The node name before '@' must be "isa" to represent the binding stick to the
  ISA/EISA binding specification.

Example:

isa@a01b0000 {
	compatible = "hisilicon,hip06-lpc";
	#address-cells = <2>;
	#size-cells = <1>;
	reg = <0x0 0xa01b0000 0x0 0x1000>;

	ipmi0: bt@e4 {
		compatible = "ipmi-bt";
		device_type = "ipmi";
		reg = <0x01 0xe4 0x04>;
	};
};
+7 −0
Original line number Diff line number Diff line
@@ -6386,6 +6386,13 @@ W: http://www.hisilicon.com
S:	Maintained
F:	drivers/net/ethernet/hisilicon/hns3/

HISILICON LPC BUS DRIVER
M:	john.garry@huawei.com
W:	http://www.hisilicon.com
S:	Maintained
F:	drivers/bus/hisi_lpc.c
F:	Documentation/devicetree/bindings/arm/hisilicon/hisilicon-low-pin-count.txt

HISILICON NETWORK SUBSYSTEM DRIVER
M:	Yisen Zhuang <yisen.zhuang@huawei.com>
M:	Salil Mehta <salil.mehta@huawei.com>
+5 −3
Original line number Diff line number Diff line
@@ -729,7 +729,8 @@ static void acpi_pci_root_validate_resources(struct device *dev,
	}
}

static void acpi_pci_root_remap_iospace(struct resource_entry *entry)
static void acpi_pci_root_remap_iospace(struct fwnode_handle *fwnode,
			struct resource_entry *entry)
{
#ifdef PCI_IOBASE
	struct resource *res = entry->res;
@@ -738,7 +739,7 @@ static void acpi_pci_root_remap_iospace(struct resource_entry *entry)
	resource_size_t length = resource_size(res);
	unsigned long port;

	if (pci_register_io_range(cpu_addr, length))
	if (pci_register_io_range(fwnode, cpu_addr, length))
		goto err;

	port = pci_address_to_pio(cpu_addr);
@@ -780,7 +781,8 @@ int acpi_pci_probe_root_resources(struct acpi_pci_root_info *info)
	else {
		resource_list_for_each_entry_safe(entry, tmp, list) {
			if (entry->res->flags & IORESOURCE_IO)
				acpi_pci_root_remap_iospace(entry);
				acpi_pci_root_remap_iospace(&device->fwnode,
						entry);

			if (entry->res->flags & IORESOURCE_DISABLED)
				resource_list_destroy_entry(entry);
+24 −9
Original line number Diff line number Diff line
@@ -1524,11 +1524,25 @@ static int acpi_check_serial_bus_slave(struct acpi_resource *ares, void *data)
	return -1;
}

static bool acpi_is_serial_bus_slave(struct acpi_device *device)
static bool acpi_is_indirect_io_slave(struct acpi_device *device)
{
	struct acpi_device *parent = device->parent;
	const struct acpi_device_id indirect_io_hosts[] = {
		{"HISI0191", 0},
		{}
	};

	return parent && !acpi_match_device_ids(parent, indirect_io_hosts);
}

static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
{
	struct list_head resource_list;
	bool is_serial_bus_slave = false;

	if (acpi_is_indirect_io_slave(device))
		return true;

	/* Macs use device properties in lieu of _CRS resources */
	if (x86_apple_machine &&
	    (fwnode_property_present(&device->fwnode, "spiSclkPeriod") ||
@@ -1560,7 +1574,8 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
	acpi_bus_get_flags(device);
	device->flags.match_driver = false;
	device->flags.initialized = true;
	device->flags.serial_bus_slave = acpi_is_serial_bus_slave(device);
	device->flags.enumeration_by_parent =
		acpi_device_enumeration_by_parent(device);
	acpi_device_clear_enumerated(device);
	device_initialize(&device->dev);
	dev_set_uevent_suppress(&device->dev, true);
@@ -1858,10 +1873,10 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used,
static void acpi_default_enumeration(struct acpi_device *device)
{
	/*
	 * Do not enumerate SPI/I2C/UART slaves as they will be enumerated by
	 * their respective parents.
	 * Do not enumerate devices with enumeration_by_parent flag set as
	 * they will be enumerated by their respective parents.
	 */
	if (!device->flags.serial_bus_slave) {
	if (!device->flags.enumeration_by_parent) {
		acpi_create_platform_device(device, NULL);
		acpi_device_set_enumerated(device);
	} else {
@@ -1958,7 +1973,7 @@ static void acpi_bus_attach(struct acpi_device *device)
		return;

	device->flags.match_driver = true;
	if (ret > 0 && !device->flags.serial_bus_slave) {
	if (ret > 0 && !device->flags.enumeration_by_parent) {
		acpi_device_set_enumerated(device);
		goto ok;
	}
@@ -1967,10 +1982,10 @@ static void acpi_bus_attach(struct acpi_device *device)
	if (ret < 0)
		return;

	if (!device->pnp.type.platform_id && !device->flags.serial_bus_slave)
		acpi_device_set_enumerated(device);
	else
	if (device->pnp.type.platform_id || device->flags.enumeration_by_parent)
		acpi_default_enumeration(device);
	else
		acpi_device_set_enumerated(device);

 ok:
	list_for_each_entry(child, &device->children, node)
+8 −0
Original line number Diff line number Diff line
@@ -65,6 +65,14 @@ config BRCMSTB_GISB_ARB
	  arbiter. This driver provides timeout and target abort error handling
	  and internal bus master decoding.

config HISILICON_LPC
	bool "Support for ISA I/O space on HiSilicon Hip06/7"
	depends on ARM64 && (ARCH_HISI || COMPILE_TEST)
	select INDIRECT_PIO
	help
	  Driver to enable I/O access to devices attached to the Low Pin
	  Count bus on the HiSilicon Hip06/7 SoC.

config IMX_WEIM
	bool "Freescale EIM DRIVER"
	depends on ARCH_MXC
Loading