From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AAD3FC433F5 for ; Mon, 4 Apr 2022 14:22:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 692EA839D4; Mon, 4 Apr 2022 16:21:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Atxs1mRc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E49B78395F; Mon, 4 Apr 2022 16:20:20 +0200 (CEST) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9B5708399E for ; Mon, 4 Apr 2022 16:19:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ed1-x530.google.com with SMTP id p23so3732606edi.8 for ; Mon, 04 Apr 2022 07:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sK+eOuWQUZq5q9YkXsze1M4hbIYfQgmOOwUA6wa6Xu8=; b=Atxs1mRcTHWnVdxAuPFHFotDDn5hSjpPfRYTUSpiI7JeZc4FneoHhDGzwMZWTcCc1F U/M4Nm8cqC1OF/n6fJYZzbGygmZrT8Fru2TL5hV7ncU2IE/lyv4KNTxYROlSL7O071rB SohhOFfHChY8LXv8SpyMqBBR6GuJs2oFEmrZbUSx6ML0bUNIik9WvhNAKC8T/Nn2TCfp 6Hpu9b/npiu4DkLqk//UEHzykNBsOXjG/u9m9au0uvoraMgQ3HMli+V4EXwb3YIzmEtf Kt+QeT5Rl0lyAP7XNyqHMplOqmVnGuJLYCCry20Ryif+8j2wz88O+7RxqY5mpqyD0J0p L4lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sK+eOuWQUZq5q9YkXsze1M4hbIYfQgmOOwUA6wa6Xu8=; b=Gk3FafxUML4F2RCARkAYUjX1ZsHpPJZU24a4WblOuGoKHcoEPI9AqtoZmgQ0zm89Ee p2RGyqs6tnbfrNMbCnijj5cT44cVvO88mr255LsITSeXwCRbEY6/Gsxot3JntTkJa+Ic Nzvg2RcjF7o9wl2EWo2sV2VbbRACeS5Vhv7o8XIbFeL0P9IOOWj9cWkYt+ieFiNuIzxG 6kl4++Vjy28LSTrewQbnI7HYWa+pldsPKyAcTEJ8rPNsA0/eLEhaQHo/4g3EnWCG0+sW 6pWGspN2B5Qm2lF1qvinzhkRkBMToA8wS2aTjDq8g0JO36YSCW5PjAm1YxQ6Cg6MFMqw aPPw== X-Gm-Message-State: AOAM533DqCYxEirO3dbmlhaoGTog6SxNmcnU0tAgOruUHpUotrn5Zvrr ybRCz0V9Yz3rJe13Prv/rTI= X-Google-Smtp-Source: ABdhPJwXRfQkouVx5NWtVr7FO9S3kmKz74zsJPzxv2vJi4CEMnLMAblR8KEq5Q3W+23C7ho+/RYUzQ== X-Received: by 2002:a05:6402:1c87:b0:41c:dd9c:2e94 with SMTP id cy7-20020a0564021c8700b0041cdd9c2e94mr335522edb.2.1649081976194; Mon, 04 Apr 2022 07:19:36 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id rh26-20020a17090720fa00b006e0da7ef847sm4462196ejb.13.2022.04.04.07.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 07:19:35 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, lukma@denx.de, seanga2@gmail.com, u-boot@lists.denx.de Subject: [PATCH v9 02/16] rockchip: rk3066: add grf header file Date: Mon, 4 Apr 2022 16:19:12 +0200 Message-Id: <20220404141926.6085-3-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220404141926.6085-1-jbx6244@gmail.com> References: <20220404141926.6085-1-jbx6244@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Paweł Jarosz grf is needed by various drivers for rk3066 soc. Signed-off-by: Paweł Jarosz Signed-off-by: Johan Jonker --- Changed V9: fix TAB Changed V8: add GRF_GPIO3B_IOMUX for SDMMC0 use GENMASK, __bf_shf and REG defines add includes --- .../include/asm/arch-rockchip/grf_rk3066.h | 210 ++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rk3066.h diff --git a/arch/arm/include/asm/arch-rockchip/grf_rk3066.h b/arch/arm/include/asm/arch-rockchip/grf_rk3066.h new file mode 100644 index 0000000000..d8e0812cee --- /dev/null +++ b/arch/arm/include/asm/arch-rockchip/grf_rk3066.h @@ -0,0 +1,210 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2021 Paweł Jarosz + */ + +#ifndef _ASM_ARCH_GRF_RK3066_H +#define _ASM_ARCH_GRF_RK3066_H + +#include +#include + +#define REG(name, h, l) \ + name##_MASK = GENMASK(h, l), \ + name##_SHIFT = __bf_shf(name##_MASK) + +struct rk3066_grf_gpio_lh { + u32 l; + u32 h; +}; + +struct rk3066_grf { + struct rk3066_grf_gpio_lh gpio_dir[7]; + struct rk3066_grf_gpio_lh gpio_do[7]; + struct rk3066_grf_gpio_lh gpio_en[7]; + + u32 gpio0a_iomux; + u32 gpio0b_iomux; + u32 gpio0c_iomux; + u32 gpio0d_iomux; + + u32 gpio1a_iomux; + u32 gpio1b_iomux; + u32 gpio1c_iomux; + u32 gpio1d_iomux; + + u32 gpio2a_iomux; + u32 gpio2b_iomux; + u32 gpio2c_iomux; + u32 gpio2d_iomux; + + u32 gpio3a_iomux; + u32 gpio3b_iomux; + u32 gpio3c_iomux; + u32 gpio3d_iomux; + + u32 gpio4a_iomux; + u32 gpio4b_iomux; + u32 gpio4c_iomux; + u32 gpio4d_iomux; + + u32 reserved0[5]; + + u32 gpio6b_iomux; + + u32 reserved1[2]; + + struct rk3066_grf_gpio_lh gpio_pull[7]; + + u32 soc_con0; + u32 soc_con1; + u32 soc_con2; + + u32 soc_status0; + + u32 dmac1_con[3]; + u32 dmac2_con[4]; + + u32 uoc0_con[3]; + u32 uoc1_con[4]; + u32 ddrc_con; + u32 ddrc_stat; + + u32 reserved2[10]; + + u32 os_reg[4]; +}; + +check_member(rk3066_grf, os_reg[3], 0x01d4); + +/* GRF_GPIO1B_IOMUX */ +enum { + REG(GPIO1B1, 2, 2), + GPIO1B1_GPIO = 0, + GPIO1B1_UART2_SOUT, + + REG(GPIO1B0, 0, 0), + GPIO1B0_GPIO = 0, + GPIO1B0_UART2_SIN +}; + +/* GRF_GPIO3B_IOMUX */ +enum { + REG(GPIO3B6, 12, 12), + GPIO3B6_GPIO = 0, + GPIO3B6_SDMMC0_DECTN, + + REG(GPIO3B5, 10, 10), + GPIO3B5_GPIO = 0, + GPIO3B5_SDMMC0_DATA3, + + REG(GPIO3B4, 8, 8), + GPIO3B4_GPIO = 0, + GPIO3B4_SDMMC0_DATA2, + + REG(GPIO3B3, 6, 6), + GPIO3B3_GPIO = 0, + GPIO3B3_SDMMC0_DATA1, + + REG(GPIO3B2, 4, 4), + GPIO3B2_GPIO = 0, + GPIO3B2_SDMMC0_DATA0, + + REG(GPIO3B1, 2, 2), + GPIO3B1_GPIO = 0, + GPIO3B1_SDMMC0_CMD, + + REG(GPIO3B0, 0, 0), + GPIO3B0_GPIO = 0, + GPIO3B0_SDMMC0_CLKOUT, +}; + +/* GRF_SOC_CON0 */ +enum { + REG(SMC_MUX_CON, 13, 13), + + REG(NOC_REMAP, 12, 12), + + REG(EMMC_FLASH_SEL, 11, 11), + + REG(TZPC_REVISION, 10, 7), + + REG(L2CACHE_ACC, 6, 5), + + REG(L2RD_WAIT, 4, 3), + + REG(IMEMRD_WAIT, 2, 1), + + REG(SOC_REMAP, 0, 0), +}; + +/* GRF_SOC_CON1 */ +enum { + REG(RKI2C4_SEL, 15, 15), + + REG(RKI2C3_SEL, 14, 14), + + REG(RKI2C2_SEL, 13, 13), + + REG(RKI2C1_SEL, 12, 12), + + REG(RKI2C0_SEL, 11, 11), + + REG(VCODEC_SEL, 10, 10), + + REG(PERI_EMEM_PAUSE, 9, 9), + + REG(PERI_USB_PAUSE, 8, 8), + + REG(SMC_MUX_MODE_0, 6, 6), + + REG(SMC_SRAM_MW_0, 5, 4), + + REG(SMC_REMAP_0, 3, 3), + + REG(SMC_A_GT_M0_SYNC, 2, 2), + + REG(EMAC_SPEED, 1, 1), + + REG(EMAC_MODE, 0, 0), +}; + +/* GRF_SOC_CON2 */ +enum { + REG(MSCH4_MAINDDR3, 7, 7), + MSCH4_MAINDDR3_DDR3 = 1, + + REG(EMAC_NEWRCV_EN, 6, 6), + + REG(SW_ADDR15_EN, 5, 5), + + REG(SW_ADDR16_EN, 4, 4), + + REG(SW_ADDR17_EN, 3, 3), + + REG(BANK2_TO_RANK_EN, 2, 2), + + REG(RANK_TO_ROW15_EN, 1, 1), + + REG(UPCTL_C_ACTIVE_IN, 0, 0), + UPCTL_C_ACTIVE_IN_MAY = 0, + UPCTL_C_ACTIVE_IN_WILL, +}; + +/* GRF_DDRC_CON0 */ +enum { + REG(DTO_LB, 12, 11), + + REG(DTO_TE, 10, 9), + + REG(DTO_PDR, 8, 7), + + REG(DTO_PDD, 6, 5), + + REG(DTO_IOM, 4, 3), + + REG(DTO_OE, 2, 1), + + REG(ATO_AE, 0, 0), +}; +#endif -- 2.20.1