Hello Nicolas Boichat,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/46384
to review the following change.
Change subject: HACK: asurada: mainboard: Set pinctrl for msdc0/emmc ......................................................................
HACK: asurada: mainboard: Set pinctrl for msdc0/emmc
For some reason I can't do that correctly in kernel.
BUG=none TEST=boot asurada, lsblk shows /dev/mmcblk0
Change-Id: I921f8c4d75c96c89ec0bc8df8f66b9af789adf97 --- M src/mainboard/google/asurada/mainboard.c 1 file changed, 52 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/46384/1
diff --git a/src/mainboard/google/asurada/mainboard.c b/src/mainboard/google/asurada/mainboard.c index 9146d7b..b77b3ba 100644 --- a/src/mainboard/google/asurada/mainboard.c +++ b/src/mainboard/google/asurada/mainboard.c @@ -2,10 +2,62 @@
#include <console/console.h> #include <device/device.h> +#include <device/mmio.h> +#include <lib.h> +#include <soc/gpio_common.h> #include <soc/usb.h>
+static void sdr_set_field(void *addr, u32 field, u32 val) +{ + u32 tv = read32(addr); + + tv &= ~field; + tv |= ((val) << (__ffs(field))); + write32(addr, tv); +} + static void mainboard_init(struct device *dev) { + int i; + + /* HACK, set pinctrl for SD card */ + for (i = 51; i <= 56; i++) + gpio_set_mode((gpio_t){.id = i}, 1); + + /* HACK, set pinctrl for eMMC */ + for (i = 183; i <= 194; i++) + gpio_set_mode((gpio_t){.id = i}, 1); + + + /** MSDC1 **/ + /*emmc pupd*/ + volatile uint32_t *pupd = (volatile uint32_t *)0x11C20060; + printk(BIOS_ERR, "pupd = %04x\n", *pupd); + *pupd = 0xfc1; + printk(BIOS_ERR, "pupd = %04x\n", *pupd); + + /*emmc driving*/ + volatile uint32_t *driv = (volatile uint32_t *)0x11C20000; + printk(BIOS_ERR, "driv = %04x\n", *driv); + *driv = 0x09249000 << 1; + printk(BIOS_ERR, "driv = %04x\n", *driv); + +// sdr_set_field(host->gpio_base, 0x3fffffff, 0x24924924); + + /** MSDC0 **/ + void *gpio_base = (void *)IOCFG_TL_BASE; + /*emmc ies*/ + sdr_set_field(gpio_base + 0x20, 0xFFF, 0xFFF); + /*emmc smt*/ + sdr_set_field(gpio_base + 0x90, 0xFFF, 0xFFF); + /*emmc pupd*/ + sdr_set_field(gpio_base + 0x30, 0x7ff, 0x401); + sdr_set_field(gpio_base + 0x40, 0x7ff, 0x3FE); + sdr_set_field(gpio_base + 0x50, 0x7fff, 0x401); + + /*emmc driving*/ + sdr_set_field(gpio_base, 0x3fffffff, 0x24924924); + setup_usb_host(); }
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/46384 )
Change subject: HACK: asurada: mainboard: Set pinctrl for msdc0/emmc ......................................................................
Patch Set 7:
@yidi can you replace this by https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/+... ?
Yidi Lin has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/46384 )
Change subject: HACK: asurada: mainboard: Set pinctrl for msdc0/emmc ......................................................................
Abandoned
replace with CB:46685