Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34464 )
Change subject: src/soc/intel/byatrail: Add minimal SMBus support ......................................................................
src/soc/intel/byatrail: Add minimal SMBus support
Change-Id: I6b7bdbc94cfbc9fbd8eda92ca924c74638388bfb Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/soc/intel/baytrail/Kconfig M src/soc/intel/baytrail/Makefile.inc A src/soc/intel/baytrail/smbus.c 3 files changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/34464/1
diff --git a/src/soc/intel/baytrail/Kconfig b/src/soc/intel/baytrail/Kconfig index 4b816a2..f5a1d81 100644 --- a/src/soc/intel/baytrail/Kconfig +++ b/src/soc/intel/baytrail/Kconfig @@ -40,6 +40,7 @@ select POSTCAR_CONSOLE select CPU_INTEL_COMMON select CPU_HAS_L2_ENABLE_MSR + select SOUTHBRIDGE_INTEL_COMMON_SMBUS
config VBOOT select VBOOT_MUST_REQUEST_DISPLAY diff --git a/src/soc/intel/baytrail/Makefile.inc b/src/soc/intel/baytrail/Makefile.inc index 3ad6a8f..55af6e6 100644 --- a/src/soc/intel/baytrail/Makefile.inc +++ b/src/soc/intel/baytrail/Makefile.inc @@ -12,6 +12,7 @@ romstage-y += iosf.c romstage-y += memmap.c romstage-y += pmutil.c +romstage-y += smbus.c romstage-y += spi.c romstage-y += stage_cache.c romstage-y += tsc_freq.c @@ -42,6 +43,7 @@ ramstage-y += sata.c ramstage-y += scc.c ramstage-y += sd.c +ramstage-y += smbus.c ramstage-y += smm.c ramstage-y += southcluster.c ramstage-y += spi.c diff --git a/src/soc/intel/baytrail/smbus.c b/src/soc/intel/baytrail/smbus.c new file mode 100644 index 0000000..91dd173 --- /dev/null +++ b/src/soc/intel/baytrail/smbus.c @@ -0,0 +1,30 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2017 Intel Corporation. + * Copyright (C) 2019 3mdeb + * Copyright (C) 2019 Eltan B.V. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <device/early_smbus.h> +#include <soc/iomap.h> +#include <southbridge/intel/common/smbus.h> + +u8 smbus_read_byte(u32 smbus_dev, u8 addr, u8 offset) +{ + return do_smbus_read_byte(SMBUS_BASE_ADDRESS, addr, offset); +} + +u8 smbus_write_byte(u32 smbus_dev, u8 addr, u8 offset, u8 value) +{ + return do_smbus_write_byte(SMBUS_BASE_ADDRESS, addr, offset, value); +}
Hello Patrick Rudolph, Patrick Georgi, Martin Roth,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34464
to look at the new patch set (#2).
Change subject: soc/intel/baytrail: Add minimal SMBus support ......................................................................
soc/intel/baytrail: Add minimal SMBus support
Taken from soc/intel/braswell.
Change-Id: I6b7bdbc94cfbc9fbd8eda92ca924c74638388bfb Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/soc/intel/baytrail/Kconfig M src/soc/intel/baytrail/Makefile.inc A src/soc/intel/baytrail/smbus.c 3 files changed, 33 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/64/34464/2
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34464 )
Change subject: soc/intel/baytrail: Add minimal SMBus support ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... File src/soc/intel/baytrail/smbus.c:
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... PS2, Line 22: u32 smbus_dev hu?
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34464 )
Change subject: soc/intel/baytrail: Add minimal SMBus support ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... File src/soc/intel/baytrail/smbus.c:
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... PS2, Line 22: u32 smbus_dev
hu?
I guess braswell is wrong :D
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34464 )
Change subject: soc/intel/baytrail: Add minimal SMBus support ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... File src/soc/intel/baytrail/smbus.c:
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... PS2, Line 22: u32 smbus_dev
I guess braswell is wrong :D
Just a broken API?
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34464 )
Change subject: soc/intel/baytrail: Add minimal SMBus support ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... File src/soc/intel/baytrail/smbus.c:
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... PS2, Line 22: u32 smbus_dev
Just a broken API?
bd82x6x:
int smbus_read_byte(unsigned device, unsigned address) { return do_smbus_read_byte(SMBUS_IO_BASE, device, address); }
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34464 )
Change subject: soc/intel/baytrail: Add minimal SMBus support ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... File src/soc/intel/baytrail/smbus.c:
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... PS2, Line 22: u32 smbus_dev
bd82x6x: […]
That's a different (imho, better) API. But not the one used by lib/spd_bin.
The caller can never know what to pass as `smbus_dev` without knowing the implementation. Hence, I call it a broken API. Doesn't mean it's the wrong API.
You are doing nothing wrong here, AFAICS.
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34464 )
Change subject: soc/intel/baytrail: Add minimal SMBus support ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... File src/soc/intel/baytrail/smbus.c:
https://review.coreboot.org/c/coreboot/+/34464/2/src/soc/intel/baytrail/smbu... PS2, Line 22: u32 smbus_dev
That's a different (imho, better) API. But not the one used by lib/spd_bin. […]
Oh, no. I take it back :) the API is not broken, there is a smbus_get_device()... So one can bikeshed if the API or all existing implementations are broken xD
Angel Pons has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/34464 )
Change subject: soc/intel/baytrail: Add minimal SMBus support ......................................................................
Abandoned