<p>Tristan Hsieh has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/28787">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mediatek/mt8183: Add USB support<br><br>This patch implements SoC-specific defines of mt8183 and link the<br>common code to support USB.<br><br>BUG=b:80501386<br>BRANCH=none<br>TEST=Boots correctly on Kukui<br><br>Change-Id: I1224cf24f92b07f3c1814f1cbfef96aafa5a992b<br>Signed-off-by: Jumin Li <jumin.li@mediatek.com><br>---<br>M src/soc/mediatek/mt8183/Makefile.inc<br>M src/soc/mediatek/mt8183/include/soc/addressmap.h<br>A src/soc/mediatek/mt8183/include/soc/usb.h<br>3 files changed, 43 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/87/28787/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/mediatek/mt8183/Makefile.inc b/src/soc/mediatek/mt8183/Makefile.inc</span><br><span>index 8fece79..c5e8120 100644</span><br><span>--- a/src/soc/mediatek/mt8183/Makefile.inc</span><br><span>+++ b/src/soc/mediatek/mt8183/Makefile.inc</span><br><span>@@ -36,6 +36,7 @@</span><br><span> ramstage-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c</span><br><span> ramstage-y += ../common/timer.c</span><br><span> ramstage-$(CONFIG_DRIVERS_UART) += ../common/uart.c</span><br><span style="color: hsl(120, 100%, 40%);">+ramstage-y += ../common/usb.c</span><br><span> ramstage-y += ../common/wdt.c</span><br><span> </span><br><span> CPPFLAGS_common += -Isrc/soc/mediatek/mt8183/include</span><br><span>diff --git a/src/soc/mediatek/mt8183/include/soc/addressmap.h b/src/soc/mediatek/mt8183/include/soc/addressmap.h</span><br><span>index de7eb1f..5527e6e 100644</span><br><span>--- a/src/soc/mediatek/mt8183/include/soc/addressmap.h</span><br><span>+++ b/src/soc/mediatek/mt8183/include/soc/addressmap.h</span><br><span>@@ -37,6 +37,8 @@</span><br><span>      SPI3_BASE               = IO_PHYS + 0x01013000,</span><br><span>      SPI4_BASE               = IO_PHYS + 0x01014000,</span><br><span>      SPI5_BASE               = IO_PHYS + 0x01015000,</span><br><span style="color: hsl(120, 100%, 40%);">+       SSUSB_MAC_BASE          = IO_PHYS + 0x01200000,</span><br><span style="color: hsl(120, 100%, 40%);">+       SSUSB_IPPC_BASE         = IO_PHYS + 0x01203e00,</span><br><span>      IOCFG_RT_BASE           = IO_PHYS + 0x01C50000,</span><br><span>      IOCFG_RM_BASE           = IO_PHYS + 0x01D20000,</span><br><span>      IOCFG_RB_BASE           = IO_PHYS + 0x01D30000,</span><br><span>@@ -45,6 +47,7 @@</span><br><span>  IOCFG_BL_BASE           = IO_PHYS + 0x01E90000,</span><br><span>      IOCFG_LT_BASE           = IO_PHYS + 0x01F20000,</span><br><span>      IOCFG_TL_BASE           = IO_PHYS + 0x01F30000,</span><br><span style="color: hsl(120, 100%, 40%);">+       SSUSB_SIF_BASE          = IO_PHYS + 0x01F40300,</span><br><span>      SMI_BASE                = IO_PHYS + 0x04019000,</span><br><span> };</span><br><span> </span><br><span>diff --git a/src/soc/mediatek/mt8183/include/soc/usb.h b/src/soc/mediatek/mt8183/include/soc/usb.h</span><br><span>new file mode 100644</span><br><span>index 0000000..505958f</span><br><span>--- /dev/null</span><br><span>+++ b/src/soc/mediatek/mt8183/include/soc/usb.h</span><br><span>@@ -0,0 +1,39 @@</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+ * This file is part of the coreboot project.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * Copyright 2018 MediaTek Inc.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is free software; you can redistribute it and/or modify</span><br><span style="color: hsl(120, 100%, 40%);">+ * it under the terms of the GNU General Public License as published by</span><br><span style="color: hsl(120, 100%, 40%);">+ * the Free Software Foundation; version 2 of the License.</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This program is distributed in the hope that it will be useful,</span><br><span style="color: hsl(120, 100%, 40%);">+ * but WITHOUT ANY WARRANTY; without even the implied warranty of</span><br><span style="color: hsl(120, 100%, 40%);">+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span><br><span style="color: hsl(120, 100%, 40%);">+ * GNU General Public License for more details.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#ifndef SOC_MEDIATEK_MT8183_USB_H</span><br><span style="color: hsl(120, 100%, 40%);">+#define SOC_MEDIATEK_MT8183_USB_H</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#include <soc/usb_common.h></span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+struct ssusb_sif_port {</span><br><span style="color: hsl(120, 100%, 40%);">+      struct sif_u2_phy_com u2phy;</span><br><span style="color: hsl(120, 100%, 40%);">+  u32 reserved0[64*5];</span><br><span style="color: hsl(120, 100%, 40%);">+  struct sif_u3phyd u3phyd;</span><br><span style="color: hsl(120, 100%, 40%);">+     u32 reserved1[64];</span><br><span style="color: hsl(120, 100%, 40%);">+    struct sif_u3phya u3phya;</span><br><span style="color: hsl(120, 100%, 40%);">+     struct sif_u3phya_da u3phya_da;</span><br><span style="color: hsl(120, 100%, 40%);">+       u32 reserved2[64 * 3];</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+check_member(ssusb_sif_port, u3phyd, 0x600);</span><br><span style="color: hsl(120, 100%, 40%);">+check_member(ssusb_sif_port, u3phya, 0x800);</span><br><span style="color: hsl(120, 100%, 40%);">+check_member(ssusb_sif_port, u3phya_da, 0x900);</span><br><span style="color: hsl(120, 100%, 40%);">+check_member(ssusb_sif_port, reserved2, 0xa00);</span><br><span style="color: hsl(120, 100%, 40%);">+_Static_assert(sizeof(struct ssusb_sif_port) == 0xD00,</span><br><span style="color: hsl(120, 100%, 40%);">+      "ssusb_sif_port size is wrong!");</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#define USB_PORT_NUMBER 1</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/28787">change 28787</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/28787"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I1224cf24f92b07f3c1814f1cbfef96aafa5a992b </div>
<div style="display:none"> Gerrit-Change-Number: 28787 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Tristan Hsieh <tristan.shieh@mediatek.com> </div>