Unverified Commit 15b9b995 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4433 【OLK-5.10】Add PCH less Boot support on GNR/SRF

Merge Pull Request from: @jun_miao 
 
enable the device io [SPI-NOR and I2C-SMBUS] to new platform GNR/SRF

Issue: #I8UU1X
Birch Stream. Enable smaller, cheaper, lower power motherboard/form factors on BHS.

Test log, find the spi/i2c controller and devices:

```
[root@GNRAP01 ~]# uname -a
Linux GNRAP01 5.10.0-gnr-core-PCHlessboot+ #2 SMP Fri Dec 29 17:18:35 CST 2023 x86_64 x86_64 x86_64 GNU/Linux
[root@GNRAP01 ~]# lsmod |grep -i spi
intel_spi_pci          16384  0
intel_spi              24576  1 intel_spi_pci
spi_nor                73728  1 intel_spi
mtd                    81920  3 spi_nor,intel_spi
[root@GNRAP01 ~]# lsmod |grep -i 801
i2c_i801               32768  0
i2c_smbus              20480  1 i2c_i801
[root@GNRAP01 ~]# lspci |grep -i bus
00:1f.4 SMBus: Intel Corporation Device 5796
00:1f.5 Serial bus controller: Intel Corporation Device 5794 (rev 09)
[root@GNRAP01 ~]# lspci -vnn -s 00:1f.4
00:1f.4 SMBus [0c05]: Intel Corporation Device [8086:5796]
        Subsystem: Intel Corporation Device [8086:7270]
        Flags: medium devsel, IRQ 16, NUMA node 0
        Memory at 1e0fff9d0000 (64-bit, non-prefetchable) [size=256]
        I/O ports at 0780 [size=32]
        Kernel driver in use: i801_smbus
        Kernel modules: i2c_i801

[root@GNRAP01 ~]# lspci -vnn -s 00:1f.5
00:1f.5 Serial bus controller [0c80]: Intel Corporation Device [8086:5794] (rev 09)
        Subsystem: Intel Corporation Device [8086:7270]
        Flags: fast devsel, NUMA node 0
        Memory at f6830000 (32-bit, non-prefetchable) [size=4K]
        Kernel driver in use: intel-spi
        Kernel modules: intel_spi_pci

[root@GNRAP01 ~]# ls /sys/class/mtd/mtd0
mtd0/   mtd0ro/
[root@GNRAP01 ~]# cat /sys/class/mtd/mtd0/name
BIOS
[root@GNRAP01 ~]# cat /sys/class/i2c-adapter/i2c-
i2c-0/ i2c-1/
[root@GNRAP01 ~]# cat /sys/class/i2c-adapter/i2c-0/
cat: /sys/class/i2c-adapter/i2c-0/: Is a directory
[root@GNRAP01 ~]# cat /sys/class/i2c-adapter/i2c-0/
delete_device  device/        name           new_device     power/         subsystem/     uevent
[root@GNRAP01 ~]# cat /sys/class/i2c-adapter/i2c-0/nae
cat: /sys/class/i2c-adapter/i2c-0/nae: No such file or directory
[root@GNRAP01 ~]# cat /sys/class/i2c-adapter/i2c-0/name
AST i2c bit bus
```
 
 
Link:https://gitee.com/openeuler/kernel/pulls/4433

 

Reviewed-by: default avatarJason Zeng <jason.zeng@intel.com>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parents 727ed0bd 03fc6cc6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@ Supported adapters:
  * Intel Jasper Lake (SOC)
  * Intel Emmitsburg (PCH)
  * Intel Alder Lake (PCH)
  * Intel Birch Stream (SOC)

   Datasheets: Publicly available at the Intel website

+1 −0
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@ config I2C_I801
	    Jasper Lake (SOC)
	    Emmitsburg (PCH)
	    Alder Lake (PCH)
	    Birch Stream (SOC)

	  This driver can also be built as a module.  If so, the module
	  will be called i2c-i801.
+4 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@
 * Jasper Lake (SOC)		0x4da3	32	hard	yes	yes	yes
 * Comet Lake-V (PCH)		0xa3a3	32	hard	yes	yes	yes
 * Alder Lake-S (PCH)		0x7aa3	32	hard	yes	yes	yes
 * Birch Stream (SOC)		0x5796	32	hard	yes	yes	yes
 *
 * Features supported by this driver:
 * Software PEC				no
@@ -228,6 +229,7 @@
#define PCI_DEVICE_ID_INTEL_TIGERLAKE_H_SMBUS		0x43a3
#define PCI_DEVICE_ID_INTEL_ELKHART_LAKE_SMBUS		0x4b23
#define PCI_DEVICE_ID_INTEL_JASPER_LAKE_SMBUS		0x4da3
#define PCI_DEVICE_ID_INTEL_BIRCH_STREAM_SMBUS		0x5796
#define PCI_DEVICE_ID_INTEL_BROXTON_SMBUS		0x5ad4
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_S_SMBUS		0x7aa3
#define PCI_DEVICE_ID_INTEL_LYNXPOINT_SMBUS		0x8c22
@@ -1080,6 +1082,7 @@ static const struct pci_device_id i801_ids[] = {
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_TIGERLAKE_H_SMBUS) },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_JASPER_LAKE_SMBUS) },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ALDER_LAKE_S_SMBUS) },
	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_BIRCH_STREAM_SMBUS) },
	{ 0, }
};

@@ -1769,6 +1772,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
	case PCI_DEVICE_ID_INTEL_JASPER_LAKE_SMBUS:
	case PCI_DEVICE_ID_INTEL_EBG_SMBUS:
	case PCI_DEVICE_ID_INTEL_ALDER_LAKE_S_SMBUS:
	case PCI_DEVICE_ID_INTEL_BIRCH_STREAM_SMBUS:
		priv->features |= FEATURE_BLOCK_PROC;
		priv->features |= FEATURE_I2C_BLOCK_READ;
		priv->features |= FEATURE_IRQ;
+1 −0
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ static const struct pci_device_id intel_spi_pci_ids[] = {
	{ PCI_VDEVICE(INTEL, 0x43a4), (unsigned long)&cnl_info },
	{ PCI_VDEVICE(INTEL, 0x4b24), (unsigned long)&bxt_info },
	{ PCI_VDEVICE(INTEL, 0x4da4), (unsigned long)&bxt_info },
	{ PCI_VDEVICE(INTEL, 0x5794), (unsigned long)&cnl_info },
	{ PCI_VDEVICE(INTEL, 0x7aa4), (unsigned long)&cnl_info },
	{ PCI_VDEVICE(INTEL, 0xa0a4), (unsigned long)&bxt_info },
	{ PCI_VDEVICE(INTEL, 0xa1a4), (unsigned long)&bxt_info },