From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 42/57] x86: ivybridge: Use the I2C driver to perform SMbus init
Date: Tue, 8 Dec 2015 06:48:50 +0100 [thread overview]
Message-ID: <56666F42.4000807@denx.de> (raw)
In-Reply-To: <1449545956-2772-43-git-send-email-sjg@chromium.org>
Hello Simon,
Am 08.12.2015 um 04:39 schrieb Simon Glass:
> Move the init code into the I2C driver.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> arch/x86/cpu/ivybridge/cpu.c | 39 +++------------------------------------
> arch/x86/dts/chromebook_link.dts | 6 ++++++
> configs/chromebook_link_defconfig | 2 ++
> drivers/i2c/intel_i2c.c | 24 ++++++++++++++++++++++++
> 4 files changed, 35 insertions(+), 36 deletions(-)
Reviewed-by: Heiko Schocher <hs@denx.de>
Just only some nitpik, see below ...
> diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c
> index ed90bb2..95a9db5 100644
> --- a/arch/x86/cpu/ivybridge/cpu.c
> +++ b/arch/x86/cpu/ivybridge/cpu.c
> @@ -121,41 +121,6 @@ int arch_cpu_init_dm(void)
> return 0;
> }
>
> -static int enable_smbus(void)
> -{
> - pci_dev_t dev;
> - uint16_t value;
> -
> - /* Set the SMBus device statically. */
> - dev = PCI_BDF(0x0, 0x1f, 0x3);
> -
> - /* Check to make sure we've got the right device. */
> - value = x86_pci_read_config16(dev, 0x0);
> - if (value != 0x8086) {
> - printf("SMBus controller not found\n");
> - return -ENOSYS;
> - }
> -
> - /* Set SMBus I/O base. */
> - x86_pci_write_config32(dev, SMB_BASE,
> - SMBUS_IO_BASE | PCI_BASE_ADDRESS_SPACE_IO);
> -
> - /* Set SMBus enable. */
> - x86_pci_write_config8(dev, HOSTC, HST_EN);
> -
> - /* Set SMBus I/O space enable. */
> - x86_pci_write_config16(dev, PCI_COMMAND, PCI_COMMAND_IO);
> -
> - /* Disable interrupt generation. */
> - outb(0, SMBUS_IO_BASE + SMBHSTCTL);
> -
> - /* Clear any lingering errors, so transactions can run. */
> - outb(inb(SMBUS_IO_BASE + SMBHSTSTAT), SMBUS_IO_BASE + SMBHSTSTAT);
> - debug("SMBus controller enabled\n");
> -
> - return 0;
> -}
> -
> #define PCH_EHCI0_TEMP_BAR0 0xe8000000
> #define PCH_EHCI1_TEMP_BAR0 0xe8000400
> #define PCH_XHCI_TEMP_BAR0 0xe8001000
> @@ -293,9 +258,11 @@ int print_cpuinfo(void)
> post_code(POST_EARLY_INIT);
>
> /* Enable SPD ROMs and DDR-III DRAM */
> - ret = enable_smbus();
> + ret = uclass_first_device(UCLASS_I2C, &dev);
> if (ret)
> return ret;
> + if (!dev)
> + return -ENODEV;
Hmm.. shouldn;t return uclass_first_device() -ENODEV in the
case it does not find a device?
>
> /* Prepare USB controller early in S3 resume */
> if (boot_mode == PEI_BOOT_RESUME)
[...]
bye,
Heiko
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2015-12-08 5:48 UTC|newest]
Thread overview: 125+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 3:38 [U-Boot] [PATCH 00/57] dm: x86: Convert ivybridge code to use driver model Simon Glass
2015-12-08 3:38 ` [U-Boot] [PATCH 01/57] dm: Add an init() method to the LPC uclass Simon Glass
2015-12-13 12:51 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 02/57] dm: core: Display the error number when driver binding fails Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 03/57] dm: usb: Add a compatible string for PCI EHCI controller Simon Glass
2015-12-08 9:15 ` Marek Vasut
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 04/57] dm: syscon: Allow finding devices by driver data Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 05/57] dm: pci: Convert bios_emu to use the driver model PCI API Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 06/57] x86: ivybridge: Set up the LPC device using driver model Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-15 18:57 ` Simon Glass
2015-12-17 10:00 ` Bin Meng
2015-12-18 2:49 ` Simon Glass
2015-12-08 3:38 ` [U-Boot] [PATCH 07/57] x86: ivybridge: Move lpc_early_init() to probe() Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 08/57] x86: ivybridge: Move more init to the probe() function Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 09/57] x86: ivybridge: Set up the PCH init Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 10/57] dm: x86: Add a northbridge uclass Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 11/57] x86: ivybridge: Add a driver for the bd82x6x northbridge Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 12/57] x86: ivybridge: Move northbridge init into the probe() method Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 13/57] x86: ivybridge: Move LPC and PCH init into northbridge probe() Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 14/57] x86: ivybridge: Rename lpc_init() to lpc_init_extra() Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 15/57] x86: ivybridge: Add an init() method for the bd82x6x LPC Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 16/57] x86: ivybridge: Move graphics init much later Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 17/57] x86: ivybridge: Move sandybridge init to the lpc init() method Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 18/57] x86: ivybridge: Move GPIO init to the LPC " Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 19/57] x86: ivybridge: Use common CPU init code Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 20/57] x86: ivybridge: Move CPU init code into the driver Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 21/57] x86: ivybridge: Set up the thermal target correctly Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 22/57] x86: ivybridge: Drop the dead MTRR code Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 23/57] x86: ivybridge: Move early init code into northbridge.c Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 24/57] x86: Make x86_init_cpus() static Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 25/57] x86: Don't show an error when the MRC cache is up to date Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 26/57] x86: Bring up northbridge, pch and lpc after the CPUs Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-15 18:58 ` Simon Glass
2015-12-08 3:38 ` [U-Boot] [PATCH 27/57] x86: ivybridge: Move northbridge and PCH init into drivers Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 28/57] x86: ivybridge: Use driver model PCI API in bd82x6x_pci_init() Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 29/57] x86: ivybridge: Use driver model PCI API in bd82x6x.c Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 30/57] x86: ivybridge: Move northbridge setup to the northbridge driver Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 31/57] ahci: Add an AHCI uclass Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 32/57] x86: ivybridge: Do the SATA init before relocation Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 33/57] x86: ivybridge: Drop the unused bd82x6x_init_extra() Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 34/57] x86: ivybridge: Use the SATA driver to do the init Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 35/57] x86: ivybridge: Use driver model PCI API in sata.c Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 36/57] x86: ivybridge: Move lpc_enable() into gma.c Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 37/57] x86: ivybridge: Move LPC init into LPC init() method Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 38/57] x86: ivybridge: Drop the special PCI driver Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-15 18:58 ` Simon Glass
2015-12-08 3:38 ` [U-Boot] [PATCH 39/57] x86: ivybridge: Convert lpc init code to DM PCI API Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 40/57] x86: Enable DM_USB for link and panther Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 41/57] x86: i2c: Add a stub driver for Intel I2C/SMbus Simon Glass
2015-12-08 5:45 ` Heiko Schocher
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 42/57] x86: ivybridge: Use the I2C driver to perform SMbus init Simon Glass
2015-12-08 5:48 ` Heiko Schocher [this message]
2015-12-11 2:05 ` Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 43/57] x86: ivybridge: Convert enable_usb_bar() to use DM PCI API Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-15 18:58 ` Simon Glass
2015-12-08 3:39 ` [U-Boot] [PATCH 44/57] x86: ivybridge: Convert dram_init() " Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 45/57] x86: ivybridge: Convert sdram_initialise() " Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 46/57] x86: chromebook_link: Enable the syscon uclass Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 47/57] x86: ivybridge: Convert SDRAM init to use driver model Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 48/57] x86: ivybridge: Convert report_platform to DM PCI API Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 49/57] x86: ivybridge: Convert pch.c to use " Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 50/57] x86: ivybridge: Move code from pch.c to bd82x6x.c Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 51/57] x86: ivybridge: Sort out the calls to bridge_silicon_revision() Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 52/57] x86: ivybridge: Convert EHCI init to use the DM PCI API Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 53/57] x86: ivybridge: Drop XHCI support Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 54/57] x86: ivybridge: Drop the SMM-locking code Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 55/57] x86: Set up a shared syscon numbering schema Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 56/57] x86: ivybridge: Use syscon for the GMA device Simon Glass
2015-12-13 12:58 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 57/57] x86: fdt: Drop the unused compatible strings in fdtdec Simon Glass
2015-12-13 12:58 ` Bin Meng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56666F42.4000807@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox