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 0A759C77B7F for ; Tue, 16 May 2023 11:30:55 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BB7B286643; Tue, 16 May 2023 13:30:16 +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="Fuj7W87A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4CF9A860AC; Tue, 16 May 2023 04:52:29 +0200 (CEST) Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) (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 D7BF6860A8 for ; Tue, 16 May 2023 04:52:26 +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=cfsworks@gmail.com Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1ae3a5dfa42so508685ad.0 for ; Mon, 15 May 2023 19:52:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684205545; x=1686797545; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=LZpVh32BdgNNgWeXWulggYuNg2bo9oty5DC1zEcD4YQ=; b=Fuj7W87AsXUYfdHbW+YWFdkgsqGmLlyhM82wcdps3hUKUTp37PHRNqP0ab5I+fHpmo ZY5CNt4RXud0ZiU+XNxvBOnza6u/e/cgzAhlWYfEBhNT+unGdrFLkJAURJehxTPQrPVP 4rrbZ1icnATaxFpShEuAXSmKrMD/JIXElt1fMydbugrHbigjWgnSKpiWyJirXWG7ThIn zD4e6XDYw0Q51FwwJe7FrBIFER1ct479OiG2FiBrX50K9LolgUqxvEmpRTOykvLfIeDC 4Zso5FXi7YzM1tv3agCWV20VhlEdTsfkx3WYbRV4niDwarY1WLcRT8OT7ZxAt0jtX7Fe Kpow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684205545; x=1686797545; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LZpVh32BdgNNgWeXWulggYuNg2bo9oty5DC1zEcD4YQ=; b=gkol+weV49jTXj5H9EqzSCglpqb7UARRjAv+r6uRSOJOE6/Hgmda8WnSSJOvpECx6o 7E4kgJQDuXCm0p3A9v8fbbGIIOW7sW4YK5XOATWorxJun/0PUHsxBmJc/g0G3sw3o3pE +00PB2IRcywMPRW06eYnTnaP7KKqsd2s1BpnF1zstu5p2pX1KHwHkUUUf3e3S3kxAcGD EuZY/hlcLGRUj6LLldoqEmIPYb/1xKFZ7Ou+0VehxgDb7a9sA3I8ir0j0t8Cl/7UIR4T x0YVWoXpuJ0KqMRUTyaRD4ZpqEYmyziUcVPRUwBWk7Khyn7xsDnJCIiBcGWbj8+iNEeh pUsg== X-Gm-Message-State: AC+VfDw2+fnoOikhU7d/Ahd+GXA7NeraysHh429ocxlucDr2J4cKQxjE TBAYBN+BVFwIu7HZ+dbzzac= X-Google-Smtp-Source: ACHHUZ6Ucy9KIDF3xZUIxbPd2Gp7IImv0SP2zjRIvY5cNyOadIM6T8ic0S9wPDKidcE6Cw+AF3+d1w== X-Received: by 2002:a17:902:be0b:b0:1a9:7ffb:5ed0 with SMTP id r11-20020a170902be0b00b001a97ffb5ed0mr31528385pls.59.1684205545060; Mon, 15 May 2023 19:52:25 -0700 (PDT) Received: from [10.64.107.252] (static-198-54-134-172.cust.tzulo.com. [198.54.134.172]) by smtp.gmail.com with ESMTPSA id w17-20020a170902e89100b001a5fccab02dsm14277377plg.177.2023.05.15.19.52.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 May 2023 19:52:24 -0700 (PDT) Message-ID: Date: Mon, 15 May 2023 20:52:23 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [RFC PATCH 13/17] sunxi: add early Allwinner R528/T113 SoC support Content-Language: en-US To: Andre Przywara , Samuel Holland , Jagan Teki Cc: u-boot@lists.denx.de, Icenowy Zheng , Jernej Skrabec References: <20221206004549.29015-1-andre.przywara@arm.com> <20221206004549.29015-14-andre.przywara@arm.com> From: Sam Edwards In-Reply-To: <20221206004549.29015-14-andre.przywara@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 16 May 2023 13:30:09 +0200 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.8 at phobos.denx.de X-Virus-Status: Clean On 12/5/22 17:45, Andre Przywara wrote: > diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c > index 3763ec3d2e4..33331cda5e2 100644 > --- a/arch/arm/mach-sunxi/board.c > +++ b/arch/arm/mach-sunxi/board.c > @@ -148,6 +148,10 @@ static int gpio_init(void) > sunxi_gpio_set_cfgpin(SUNXI_GPH(12), SUN9I_GPH_UART0); > sunxi_gpio_set_cfgpin(SUNXI_GPH(13), SUN9I_GPH_UART0); > sunxi_gpio_set_pull(SUNXI_GPH(13), SUNXI_GPIO_PULL_UP); > +#elif CONFIG_CONS_INDEX == 1 && defined(CONFIG_MACH_SUN8I_R528) > + sunxi_gpio_set_cfgpin(SUNXI_GPE(2), 6); > + sunxi_gpio_set_cfgpin(SUNXI_GPE(3), 6); > + sunxi_gpio_set_pull(SUNXI_GPE(3), SUNXI_GPIO_PULL_UP); > #elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUNIV) > sunxi_gpio_set_cfgpin(SUNXI_GPA(2), SUNIV_GPE_UART0); > sunxi_gpio_set_cfgpin(SUNXI_GPA(3), SUNIV_GPE_UART0); I'm a relative outsider to sunxi, but it does look like the NCAT2 generation's MUX is a lot more flexible in its UART assignments: e.g. while H3's UART1-3 only had one set of pins each UART could use, the T113 (my target) supports anywhere from 2-6 (typically 4) different options for each of its UARTs. It is not as simple as configuring which UART is the serial console anymore, because different boards might wire the console header to different pins. My particular target uses UART3 on pins PB6/PB7, for example. Since this patchset is updating the PIO driver anyway, maybe it's worth updating the (preprocessor, not runtime) logic in gpio_init to support getting the UART TX/RX pins from Kconfig, validating that the CONFIG_CONS_INDEX and pin selection are compatible, and setting the correct MUX function for those pins with a value pulled from a table?