[U-Boot] [PATCH v2 00/55] dm: x86: Convert ivybridge code to use driver model

Simon Glass sjg at chromium.org
Mon Jan 18 00:11:05 CET 2016


At present ivybridge is the only x86 implementation that includes a
reasonably full board init. This means there is a lot more code than with
a board that uses FSP (even then we don't have memory init or graphics init
code).

This code does not use proper drivers for the devices and so its use of
driver model is limited. This series refactors the code to improve this. In
particular it drops use of the old x86_pci_...() API in favour of
dm_pci_...(). The latter requires that each PCI device has a driver.

A few very minor driver model improvements are added to support this. Also a
Northbridge uclass is added - this could instead be done with the syscon, so
comments are well as to which is best.

A small amount of additional work will be needed to remove use of the
x86_pci_...() in arch/x86, but this series represents the bulk of it.

Changes in v2:
- Fix -EEPFNOSUPPORT typo
- Add missing of_match member init so that ehci_pci_ids[] is used
- Add missing 'given' word
- Drop unnecessary/incorrect non-DM code in dm_pci_run_vga_bios()
- Drop unused 'gen-dec' device tree property
- Drop the init() method in the PCH
- Rename this commit from 'x86: ivybridge: Set up the PCH init'
- Drop unnecessary DECLARE_GLOBAL_DATA_PTR
- Drop explicit PCH probe
- Drop LPC init method
- Rename patch from 'Add an init() method for the bd82x6x LPC'
- Update to drop LPC init method and use probe() instead
- Fix 'baords' typo in the commit message
- Add a comment as to why we are initing the devices again
- Drop northbridge_enable()
- Rename from 'Move northbridge setup to the northbridge driver'
- Drop this unnecessary init
- Rename the AHCI uclass to DISK
- Update to use the disk uclass
- Update to use the disk uclass
- Drop unnecessary IRQ and command register init
- Update to use LPC probe() method instead of init()
- Drop the special compatible string in chromebook_link.dts
- Expand the Kconfig help a little
- Avoid needing the pch device to set up the USB bar
- Fix incorrect bits in bridge_silicon_revision() comment
- Rename from 'Convert EHCI init to use the DM PCI API'
- Drop this init
- Fix the USB PCI address in the device tree
- Enable SYSCON and REGMAP for panther to avoid a build error
- Drop bd82x6x_pci_init() function and associated DM-conversion patch
- Drop LPC init method an 'Add an init() method to the LPC uclass' patch

Simon Glass (55):
  dm: core: Display the error number when driver binding fails
  dm: usb: Add a compatible string for PCI EHCI controller
  dm: syscon: Allow finding devices by driver data
  dm: pci: Convert bios_emu to use the driver model PCI API
  x86: ivybridge: Set up the LPC device using driver model
  x86: ivybridge: Move lpc_early_init() to probe()
  x86: ivybridge: Move more init to the probe() function
  x86: ivybridge: Rename bd82x6x_init()
  dm: x86: Add a northbridge uclass
  x86: ivybridge: Add a driver for the bd82x6x northbridge
  x86: ivybridge: Move northbridge init into the probe() method
  x86: ivybridge: Move LPC and PCH init into northbridge probe()
  x86: ivybridge: Rename lpc_init() to lpc_init_extra()
  x86: ivybridge: Probe the LPC in CPU init
  x86: ivybridge: Move graphics init much later
  x86: ivybridge: Move sandybridge init to the lpc probe() method
  x86: ivybridge: Move GPIO init to the LPC init() method
  x86: ivybridge: Use common CPU init code
  x86: ivybridge: Move CPU init code into the driver
  x86: ivybridge: Set up the thermal target correctly
  x86: ivybridge: Drop the dead MTRR code
  x86: ivybridge: Move early init code into northbridge.c
  x86: Make x86_init_cpus() static
  x86: Don't show an error when the MRC cache is up to date
  x86: Bring up northbridge, pch and lpc after the CPUs
  x86: ivybridge: Move northbridge and PCH init into drivers
  x86: ivybridge: Use driver model PCI API in bd82x6x.c
  x86: ivybridge: Drop unnecessary northbridge setup
  ahci: Add a disk-controller uclass
  x86: ivybridge: Do the SATA init before relocation
  x86: ivybridge: Drop the unused bd82x6x_init_extra()
  x86: ivybridge: Use the SATA driver to do the init
  x86: ivybridge: Use driver model PCI API in sata.c
  x86: ivybridge: Move lpc_enable() into gma.c
  x86: ivybridge: Move LPC init into the LPC probe() method
  x86: ivybridge: Drop the special PCI driver
  x86: ivybridge: Convert lpc init code to DM PCI API
  x86: Enable DM_USB for link and panther
  x86: i2c: Add a stub driver for Intel I2C/SMbus
  x86: ivybridge: Use the I2C driver to perform SMbus init
  x86: ivybridge: Convert enable_usb_bar() to use DM PCI API
  x86: ivybridge: Convert dram_init() to use DM PCI API
  x86: ivybridge: Convert sdram_initialise() to use DM PCI API
  x86: chromebook_link: Enable the syscon uclass
  x86: ivybridge: Convert SDRAM init to use driver model
  x86: ivybridge: Convert report_platform to DM PCI API
  x86: ivybridge: Convert pch.c to use DM PCI API
  x86: ivybridge: Move code from pch.c to bd82x6x.c
  x86: ivybridge: Sort out the calls to bridge_silicon_revision()
  x86: ivybridge: Drop special EHCI init
  x86: ivybridge: Drop XHCI support
  x86: ivybridge: Drop the SMM-locking code
  x86: Set up a shared syscon numbering schema
  x86: ivybridge: Use syscon for the GMA device
  x86: fdt: Drop the unused compatible strings in fdtdec

 arch/x86/cpu/cpu.c                                |  22 +-
 arch/x86/cpu/ivybridge/Makefile                   |   5 -
 arch/x86/cpu/ivybridge/bd82x6x.c                  | 217 ++++++++++------
 arch/x86/cpu/ivybridge/cpu.c                      | 146 +++--------
 arch/x86/cpu/ivybridge/early_init.c               | 147 -----------
 arch/x86/cpu/ivybridge/early_me.c                 |  70 +++--
 arch/x86/cpu/ivybridge/gma.c                      | 114 ++++++--
 arch/x86/cpu/ivybridge/lpc.c                      | 301 ++++++++++++----------
 arch/x86/cpu/ivybridge/model_206ax.c              | 126 ++++-----
 arch/x86/cpu/ivybridge/northbridge.c              | 126 ++++++---
 arch/x86/cpu/ivybridge/pch.c                      | 123 ---------
 arch/x86/cpu/ivybridge/pci.c                      |  67 -----
 arch/x86/cpu/ivybridge/report_platform.c          |  11 +-
 arch/x86/cpu/ivybridge/sata.c                     | 132 ++++++----
 arch/x86/cpu/ivybridge/sdram.c                    |  64 +++--
 arch/x86/cpu/ivybridge/usb_ehci.c                 |  29 ---
 arch/x86/cpu/ivybridge/usb_xhci.c                 |  32 ---
 arch/x86/dts/chromebook_link.dts                  |  86 ++++++-
 arch/x86/include/asm/arch-ivybridge/bd82x6x.h     |  23 +-
 arch/x86/include/asm/arch-ivybridge/me.h          |  45 +++-
 arch/x86/include/asm/arch-ivybridge/pch.h         |  27 +-
 arch/x86/include/asm/arch-ivybridge/sandybridge.h |  13 +-
 arch/x86/include/asm/cpu.h                        |  11 +
 arch/x86/include/asm/u-boot-x86.h                 |   2 -
 arch/x86/lib/Makefile                             |   1 +
 arch/x86/lib/mrccache.c                           |   6 +-
 arch/x86/lib/northbridge-uclass.c                 |  15 ++
 board/google/chromebook_link/link.c               |   8 -
 configs/chromebook_link_defconfig                 |   9 +
 configs/chromebox_panther_defconfig               |   4 +
 drivers/bios_emulator/atibios.c                   | 109 +++++++-
 drivers/bios_emulator/bios.c                      |  39 +++
 drivers/block/Kconfig                             |   9 +
 drivers/block/Makefile                            |   1 +
 drivers/block/disk-uclass.c                       |  14 +
 drivers/core/lists.c                              |   3 +-
 drivers/core/syscon-uclass.c                      |  31 ++-
 drivers/i2c/Kconfig                               |   9 +
 drivers/i2c/Makefile                              |   1 +
 drivers/i2c/intel_i2c.c                           |  75 ++++++
 drivers/pci/pci_rom.c                             |   6 +-
 drivers/usb/host/ehci-pci.c                       |   6 +
 include/bios_emul.h                               |  19 +-
 include/dm/uclass-id.h                            |   2 +
 include/fdtdec.h                                  |   5 -
 include/syscon.h                                  |  14 +
 lib/fdtdec.c                                      |   5 -
 test/dm/syscon.c                                  |  17 ++
 48 files changed, 1288 insertions(+), 1059 deletions(-)
 delete mode 100644 arch/x86/cpu/ivybridge/early_init.c
 delete mode 100644 arch/x86/cpu/ivybridge/pch.c
 delete mode 100644 arch/x86/cpu/ivybridge/pci.c
 delete mode 100644 arch/x86/cpu/ivybridge/usb_ehci.c
 delete mode 100644 arch/x86/cpu/ivybridge/usb_xhci.c
 create mode 100644 arch/x86/lib/northbridge-uclass.c
 create mode 100644 drivers/block/disk-uclass.c
 create mode 100644 drivers/i2c/intel_i2c.c

-- 
2.6.0.rc2.230.g3dd15c0



More information about the U-Boot mailing list