Skip to content

Instantly share code, notes, and snippets.

@KunYi
Created July 31, 2024 08:55
Show Gist options
  • Save KunYi/fdcbe5e43f5a0f8a4e63157dbfae4ebe to your computer and use it in GitHub Desktop.
Save KunYi/fdcbe5e43f5a0f8a4e63157dbfae4ebe to your computer and use it in GitHub Desktop.
LattePanda Mu GPIO Inititionlization Code for EMMC/HDMI(DDIB)
/* SPDX-License-Identifier: GPL-2.0-only */
#include <baseboard/gpio.h>
#include <baseboard/variants.h>
#include <commonlib/helpers.h>
/* Pad configuration in ramstage*/
static const struct pad_config gpio_table[] = {
/* ESPI_IO0_EC_R / ESPI_IO0_HDR */
PAD_CFG_NF(GPP_A0, NONE, DEEP, NF1),
/* ESPI_IO1_EC_R / ESPI_IO1_HDR */
PAD_CFG_NF(GPP_A1, NONE, DEEP, NF1),
/* ESPI_IO2_EC_R / ESPI_IO2_HDR */
PAD_CFG_NF(GPP_A2, NONE, DEEP, NF1),
/* ESPI_IO3_EC_R / ESPI_IO3_HDR */
PAD_CFG_NF(GPP_A3, NONE, DEEP, NF1),
/* ESPI_CS0_EC_R_N / ESPI_CS0_HDR_N */
PAD_CFG_NF(GPP_A4, NONE, DEEP, NF1),
/* ESPI_ALERT0_EC_R_N / ESPI_ALERT0_HDR_N */
PAD_CFG_NF(GPP_A5, NONE, DEEP, NF1),
/* ESPI_CLK_EC_R / ESPI_CLK_HDR */
PAD_CFG_NF(GPP_A9, NONE, DEEP, NF1),
/* ESPI_RST_EC_R_N / ESPI_RST_HDR_N */
PAD_CFG_NF(GPP_A10, NONE, DEEP, NF1),
/* H15 : DDPB_CTRLCLK ==> DDIB_HDMI_CTRLCLK */
PAD_CFG_NF(GPP_H15, NONE, DEEP, NF1),
/* H17 : DDPB_CTRLDATA ==> DDIB_HDMI_CTRLDATA */
PAD_CFG_NF(GPP_H17, NONE, DEEP, NF1),
/* I5 : NC */
PAD_NC(GPP_I5, NONE),
/* I7 : EMMC_CMD ==> EMMC_CMD */
PAD_CFG_NF(GPP_I7, NONE, DEEP, NF1),
/* I8 : EMMC_DATA0 ==> EMMC_D0 */
PAD_CFG_NF(GPP_I8, NONE, DEEP, NF1),
/* I9 : EMMC_DATA1 ==> EMMC_D1 */
PAD_CFG_NF(GPP_I9, NONE, DEEP, NF1),
/* I10 : EMMC_DATA2 ==> EMMC_D2 */
PAD_CFG_NF(GPP_I10, NONE, DEEP, NF1),
/* I11 : EMMC_DATA3 ==> EMMC_D3 */
PAD_CFG_NF(GPP_I11, NONE, DEEP, NF1),
/* I12 : EMMC_DATA4 ==> EMMC_D4 */
PAD_CFG_NF(GPP_I12, NONE, DEEP, NF1),
/* I13 : EMMC_DATA5 ==> EMMC_D5 */
PAD_CFG_NF(GPP_I13, NONE, DEEP, NF1),
/* I14 : EMMC_DATA6 ==> EMMC_D6 */
PAD_CFG_NF(GPP_I14, NONE, DEEP, NF1),
/* I15 : EMMC_DATA7 ==> EMMC_D7 */
PAD_CFG_NF(GPP_I15, NONE, DEEP, NF1),
/* I16 : EMMC_RCLK ==> EMMC_RCLK */
PAD_CFG_NF(GPP_I16, NONE, DEEP, NF1),
/* I17 : EMMC_CLK ==> EMMC_CLK */
PAD_CFG_NF(GPP_I17, NONE, DEEP, NF1),
/* I18 : EMMC_RESET# ==> EMMC_RST_L */
PAD_CFG_NF(GPP_I18, NONE, DEEP, NF1),
/* EDP1_HPD_MIPI_PNL_RST */
PAD_CFG_NF(GPP_E14, NONE, DEEP, NF1),
/* PM_SLP_S0_N */
PAD_CFG_NF(GPP_B12, NONE, DEEP, NF1),
/* PLT_RST_N */
PAD_CFG_NF(GPP_B13, NONE, DEEP, NF1),
/* PM_SLP_DRAM_N */
PAD_CFG_NF(GPP_E8, NONE, DEEP, NF2),
/* CPU_C10_GATE_N_R */
PAD_CFG_NF(GPP_H18, NONE, DEEP, NF1),
/* DDIB_DP_HDMI_ALS_HDP */
PAD_CFG_NF(GPP_A18, NONE, DEEP, NF1),
};
void variant_configure_gpio_pads(void)
{
gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment