Isaac Christensen (isaac.christensen@se-eng.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6826
-gerrit
commit 0b660dee64bfa49168970c8454eecb1b55667117 Author: Duncan Laurie dlaurie@chromium.org Date: Sun Oct 13 10:57:01 2013 +0800
samus: Add onboard device configuration
Change-Id: Ib7b6688982e9f74cffe40d11d4a9ec69acd55d37 Signed-off-by: Duncan Laurie dlaurie@chromium.org Reviewed-on: https://chromium-review.googlesource.com/174088 Reviewed-by: Aaron Durbin adurbin@chromium.org (cherry picked from commit 41624b073fb59b1372ee5a8eba3ed64c7e633311) Signed-off-by: Isaac Christensen isaac.christensen@se-eng.com --- src/mainboard/google/samus/mainboard.c | 40 ++++++++++++++++++++++++++++++++-- src/mainboard/google/samus/onboard.h | 39 +++++++++++++++++++++++++++++++-- 2 files changed, 75 insertions(+), 4 deletions(-)
diff --git a/src/mainboard/google/samus/mainboard.c b/src/mainboard/google/samus/mainboard.c index 641d331..09ed252 100644 --- a/src/mainboard/google/samus/mainboard.c +++ b/src/mainboard/google/samus/mainboard.c @@ -146,7 +146,7 @@ static int mainboard_smbios_data(device_t dev, int *handle, BOARD_TRACKPAD_IRQ, /* instance */ BOARD_TRACKPAD_I2C_BUS, /* segment */ BOARD_TRACKPAD_I2C_ADDR, /* bus */ - 0, /* device */ + BOARD_TRACKPAD_IRQ_TYPE, /* device */ 0); /* function */
len += smbios_write_type41( @@ -155,7 +155,43 @@ static int mainboard_smbios_data(device_t dev, int *handle, BOARD_TOUCHSCREEN_IRQ, /* instance */ BOARD_TOUCHSCREEN_I2C_BUS, /* segment */ BOARD_TOUCHSCREEN_I2C_ADDR, /* bus */ - 0, /* device */ + BOARD_TOUCHSCREEN_IRQ_TYPE, /* device */ + 0); /* function */ + + len += smbios_write_type41( + current, handle, + BOARD_CODEC_NAME, /* name */ + BOARD_CODEC_IRQ, /* instance */ + BOARD_CODEC_I2C_BUS, /* segment */ + BOARD_CODEC_I2C_ADDR, /* bus */ + BOARD_CODEC_IRQ_TYPE, /* device */ + 0); /* function */ + + len += smbios_write_type41( + current, handle, + BOARD_NFC_NAME, /* name */ + BOARD_NFC_IRQ, /* instance */ + BOARD_NFC_I2C_BUS, /* segment */ + BOARD_NFC_I2C_ADDR, /* bus */ + BOARD_NFC_IRQ_TYPE, /* device */ + 0); /* function */ + + len += smbios_write_type41( + current, handle, + BOARD_ACCEL_NAME, /* name */ + BOARD_ACCEL_IRQ, /* instance */ + BOARD_ACCEL_I2C_BUS, /* segment */ + BOARD_ACCEL_I2C_ADDR, /* bus */ + BOARD_ACCEL_IRQ_TYPE, /* device */ + 0); /* function */ + + len += smbios_write_type41( + current, handle, + BOARD_ACCEL_GYRO_NAME, /* name */ + BOARD_ACCEL_GYRO_IRQ, /* instance */ + BOARD_ACCEL_GYRO_I2C_BUS, /* segment */ + BOARD_ACCEL_GYRO_I2C_ADDR, /* bus */ + BOARD_ACCEL_GYRO_IRQ_TYPE, /* device */ 0); /* function */
return len; diff --git a/src/mainboard/google/samus/onboard.h b/src/mainboard/google/samus/onboard.h index c74ce22..2824467 100644 --- a/src/mainboard/google/samus/onboard.h +++ b/src/mainboard/google/samus/onboard.h @@ -20,16 +20,51 @@ #ifndef ONBOARD_H #define ONBOARD_H
+#define BOARD_PIRQ_INTERRUPT 0 +#define BOARD_GPIO_INTERRUPT 1 +#define BOARD_GPIO_OFFSET 162 +#define GPIO_INTERRUPT(x) (BOARD_GPIO_OFFSET + (x)) + #define BOARD_TRACKPAD_NAME "trackpad" #define BOARD_TRACKPAD_IRQ 27 /* PIRQL */ +#define BOARD_TRACKPAD_IRQ_TYPE BOARD_PIRQ_INTERRUPT #define BOARD_TRACKPAD_WAKE_GPIO 13 /* GPIO13 */ #define BOARD_TRACKPAD_I2C_BUS 1 /* I2C0 */ -#define BOARD_TRACKPAD_I2C_ADDR 0x67 +#define BOARD_TRACKPAD_I2C_ADDR 0x4b
#define BOARD_TOUCHSCREEN_NAME "touchscreen" #define BOARD_TOUCHSCREEN_IRQ 28 /* PIRQM */ +#define BOARD_TOUCHSCREEN_IRQ_TYPE BOARD_PIRQ_INTERRUPT #define BOARD_TOUCHSCREEN_WAKE_GPIO 14 /* GPIO14 */ #define BOARD_TOUCHSCREEN_I2C_BUS 2 /* I2C1 */ -#define BOARD_TOUCHSCREEN_I2C_ADDR 0x4a +#define BOARD_TOUCHSCREEN_I2C_ADDR 0x4b + +#define BOARD_CODEC_NAME "codec" +#define BOARD_CODEC_IRQ GPIO_INTERRUPT(42) +#define BOARD_CODEC_IRQ_TYPE BOARD_GPIO_INTERRUPT +#define BOARD_CODEC_WAKE_GPIO 42 /* GPIO42 */ +#define BOARD_CODEC_I2C_BUS 1 /* I2C0 */ +#define BOARD_CODEC_I2C_ADDR 0x1a + +#define BOARD_NFC_NAME "nfc" +#define BOARD_NFC_IRQ GPIO_INTERRUPT(29) +#define BOARD_NFC_IRQ_TYPE BOARD_GPIO_INTERRUPT +#define BOARD_NFC_WAKE_GPIO 29 /* GPIO29 */ +#define BOARD_NFC_I2C_BUS 1 /* I2C0 */ +#define BOARD_NFC_I2C_ADDR 0x28 + +#define BOARD_ACCEL_NAME "accel" +#define BOARD_ACCEL_IRQ GPIO_INTERRUPT(43) +#define BOARD_ACCEL_IRQ_TYPE BOARD_GPIO_INTERRUPT +#define BOARD_ACCEL_WAKE_GPIO 43 /* GPIO43 */ +#define BOARD_ACCEL_I2C_BUS 2 /* I2C1 */ +#define BOARD_ACCEL_I2C_ADDR 0x0e + +#define BOARD_ACCEL_GYRO_NAME "accel_gyro" +#define BOARD_ACCEL_GYRO_IRQ 31 /* PIRQP */ +#define BOARD_ACCEL_GYRO_IRQ_TYPE BOARD_PIRQ_INTERRUPT +#define BOARD_ACCEL_GYRO_WAKE_GPIO 47 /* GPIO47 */ +#define BOARD_ACCEL_GYRO_I2C_BUS 2 /* I2C1 */ +#define BOARD_ACCEL_GYRO_I2C_ADDR 0x6b
#endif