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 8DECBC433F5 for ; Sun, 8 May 2022 15:08:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0C85783F22; Sun, 8 May 2022 17:08:39 +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="c7LljFdM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3996B83E57; Sun, 8 May 2022 17:08:36 +0200 (CEST) Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) (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 6B5C683C0C for ; Sun, 8 May 2022 17:08:33 +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-ej1-x629.google.com with SMTP id y3so22438815ejo.12 for ; Sun, 08 May 2022 08:08:33 -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:mime-version :content-transfer-encoding; bh=aUjkMxuIpdF521ur5wLwG/JDqLE8vWJmhOImDNER35w=; b=c7LljFdMKSTux1PZ+hIlVg052UmXWQj0Y2Nwdg9AwDPa+hcdq8UKELoA43w/NqIQn5 FeSK7eSGNinD4bmOhblJZcfO9c2ZH/wCyzyONykZjhHhKxK9T7nIus6OKoeYcHob+kS3 Z40bTQhHEC2ESClboY7JMKjUL/q6ktiJurJquB11AhIg7/R8N9lttY00BlHiC2aeJZHN HHN7BGXoAXuG+KPj73h3n4d7xZGMBkrvZSejZZiDdRscb85wQccljou6k3j5cw/aYpcD I3chVLLOP4+2Ep3VbLl+jTVDgAHPi9WR88Xghld537A43xcrffCN8lXZ6M/leISJIty+ pigA== 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:mime-version :content-transfer-encoding; bh=aUjkMxuIpdF521ur5wLwG/JDqLE8vWJmhOImDNER35w=; b=EP6dh3ommza2qCAg+7n0UlqsXhIGpaBcvYrVs9cEcmKOCf1bGupaKz4QDWwcFeFld7 8PbFifT3RyLiDGmPsap127zpPZJuMHaB8IZjQXb9FAhU0DGnAMeLBx39TsudpGll7clM FBlvkhfWOwhzqflM6rY5PgfCuR3qMjfNbPvooMthzw/5llIsp75srOcNgOlBATVYBLIn 1MwI6uMQRVpjNYd/4f/9tscgGeUcJUadxnm2pC+w/yfejk2xxdb5pcuEChszAhlGkVzC Cb28ZV/ffrHg5NdMlhX0fYBdXW5e973Rg5RmNFAWY9dwM4GBBW0NVUEe29Dz5nIkZ7k0 d5sw== X-Gm-Message-State: AOAM533CIyBWIFckW7OFwVZ0lu43OVXBQ4d2lD8PqV3WUWGuTQa6Q5YR 9XapGuAABRFy8n+R8iCp5lg= X-Google-Smtp-Source: ABdhPJzVHWhN/Csoeo5tSpPgm0KTQzBDxmLCn7JHPS9sAdv5G5AE38I2aCIzduJvyD2HVMm8sYK5vA== X-Received: by 2002:a17:906:414f:b0:6f3:e324:4aae with SMTP id l15-20020a170906414f00b006f3e3244aaemr11555102ejk.727.1652022512791; Sun, 08 May 2022 08:08:32 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id yl26-20020a17090693fa00b006f3ef214dc2sm4102721ejb.40.2022.05.08.08.08.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 08:08:32 -0700 (PDT) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, lukma@denx.de, marex@denx.de, u-boot@lists.denx.de Subject: [PATCH v1 00/17] Add rk3066 ADC and USB support Date: Sun, 8 May 2022 17:08:08 +0200 Message-Id: <20220508150825.21711-1-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 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 Add rk3066 ADC and USB support. The Rockchip SoC rk3066 has no support for MMC and USB in the BootROM. The TPL/SPL parts are mostly stored on NAND. With U-boot stored on an external media the moment a user wants to start a recovery action it has to be done in SPL. Some boards only have one ADC switch for the user and no serial console. The U-boot USB drivers only works in combination with OF_REAL enabled. For current ARM SoCs the FDT stored in BBS is erased after SPL relocation in the crt0.S main function. So for drivers to work in SPL, FDT is move to the end of DRAM. The global_data must update there pointers. The common Rockchip functions must also become available in SPL. Most work has to be done on the ADC driver that has recently had a "upgrade" for a vref regulator. For Rockchip this regulator are mostly fixed. As we are in SPL that would introduce 2 extra U-boot classes UCLASS_REGULATOR and UCLASS_GPIO. In SPL there's no pin control yet, so reduce code and read these ADC properties from the DT in SPL. While testing some improvement had to be made for reliability. Fixup SPL compile and the way the ADC section is shown in U-boot's main menu. Add a __weak recovery button function as condition to enter the recovery mode in spl. It then looks for a boot_device to select a storage function method. And finally run the rockusb gadget while connected to a USB host. Enable all new futures by adding them to the mk808_defconfig. Johan Jonker (16): rockchip: spl: fix reloc gd and FDT blob pointer rockchip: spl: allow more boot devices rockchip: spl-boot-order: add usb boot option rockchip: board: allow spl compile for usb init functions rockchip: usb: gadget: rockusb: enable spl compile rockchip: configs: mk808: add spl usb configs arm: dts: rockchip: mk808: add adc usb required properties for spl rockchip: adc: enable spl compile class driver rockchip: adc: reduce error notifications from class driver rockchip: adc: enable spl compile rockchip-saradc driver rockchip: adc: fix adc timer rockchip: adc: fix the hangups rockchip: adc: make adc branch compile in SPL rockchip: adc: move config items in a sub menu rockchip: rk3066: add recovery mode in spl rockchip: configs: mk808: enable usb support Paweł Jarosz (1): rockchip: rk3066: config nand data pins in spl arch/arm/dts/rk3066a-mk808-u-boot.dtsi | 29 ++++++ .../arm/include/asm/arch-rockchip/f_rockusb.h | 1 + arch/arm/mach-rockchip/Makefile | 3 +- arch/arm/mach-rockchip/rk3066/rk3066.c | 93 ++++++++++++++++++- arch/arm/mach-rockchip/sdram.c | 1 + arch/arm/mach-rockchip/spl-boot-order.c | 3 + arch/arm/mach-rockchip/spl.c | 21 ++++- configs/mk808_defconfig | 21 ++++- drivers/Makefile | 3 +- drivers/adc/Kconfig | 33 +++++++ drivers/adc/Makefile | 4 +- drivers/adc/adc-uclass.c | 47 +++++++--- drivers/adc/rockchip-saradc.c | 71 ++++++++++---- drivers/usb/gadget/Kconfig | 10 ++ drivers/usb/gadget/Makefile | 2 +- include/configs/mk808.h | 3 + 16 files changed, 308 insertions(+), 37 deletions(-) -- 2.20.1