From patchwork Wed Jun 30 15:23:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zong Li X-Patchwork-Id: 1498985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=ET52K2Vx; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GFQxb57X7z9sVb for ; Thu, 1 Jul 2021 01:58:43 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 942988314C; Wed, 30 Jun 2021 17:58:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.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=sifive.com header.i=@sifive.com header.b="ET52K2Vx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A756B82DF8; Wed, 30 Jun 2021 17:24:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) (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 2A34382BEA for ; Wed, 30 Jun 2021 17:23:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=zong.li@sifive.com Received: by mail-pl1-x630.google.com with SMTP id c15so1636134pls.13 for ; Wed, 30 Jun 2021 08:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GXzayy3SVQMRsfc4PzJB5UZKo9bTLsAJE0NTEEhNPHk=; b=ET52K2VxLqcAr7mapBiSs+1YTfTFFFdFxpc7D6sgDrgFEMVFLRkawUldU/RxxTFp2b M9XaeEX0oeN6iMkr3iNj57DzVJSDieDww02ydjoyw3ifiENHyvyWjp+cRy3njJN2KkHL DWZtIhpq0W8GB45e/zLfAldTDS441ENxsgUiAZbpF541+qWwFPwmFqsXlX0A1El3I/KS zgG3uzLhYje58ELqZBZT38y9o/el2IT17iSzLei7LIIeJJdY5EwJJtElxk+c6vu/YB+X VZV7Zvi0PJyHmk+f1kR+hhk6iOovaiTrUEw4n2NVPUNr/zinnhNIyUQ7v4mP64ZEzCf+ FRSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GXzayy3SVQMRsfc4PzJB5UZKo9bTLsAJE0NTEEhNPHk=; b=Cr2irfCGrGMC7wFP0EDmHF6KwSb8IqcSIEbX3V1SPJc/OIT3tJH0utdQE7RihrXWnR jj2kr9xHyP0Ip/WP7zYK+aRWE6eySFOOZgvRAJWEiiTqbxEs+jsTgYuCOOCjSeno0edH TJLvhyOILP4OfpsOQ0NPdLEMHBx4HR7YA0tkF4hBe05FGaW0CAXIXJXaa+3mUqzJHYB9 Pk1/oThjmddwa12gRsHD2neCu81kP9ME/CNAXZncwq6r46rU4WU3JT7sdFAfIbwpMKJW SCJhScbT7CmILck0D6J5yZbJrWb3A0RefOKRg5VDJuyZ5hWVL6R2XAdYkx/1flkJfgWy h99Q== X-Gm-Message-State: AOAM533JIRAAzFrw5SAn1VbwyXFRt2bXHv/DXZDswL1DCOm0D/poCxV5 EGjtbSNtZ5f/ebaqrPPQFXc6kw== X-Google-Smtp-Source: ABdhPJz6bA8lbm7UXJgk9JMyi9H15Na99ZqIIP7p2lC7oZJOWQ4kCz8xexuFKAYZ93C5/dX+cFjkAg== X-Received: by 2002:a17:902:aa83:b029:128:a188:f080 with SMTP id d3-20020a170902aa83b0290128a188f080mr25109917plr.11.1625066635313; Wed, 30 Jun 2021 08:23:55 -0700 (PDT) Received: from hsinchu16.internal.sifive.com (59-124-168-89.HINET-IP.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id m4sm6956970pjv.41.2021.06.30.08.23.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 08:23:54 -0700 (PDT) From: Zong Li To: paul.walmsley@sifive.com, green.wan@sifive.com, pragnesh.patel@sifive.com, sagar.kadam@sifive.com, rick@andestech.com, ycliang@andestech.com, bmeng.cn@gmail.com, u-boot@lists.denx.de Cc: Zong Li Subject: [PATCH 0/6] Support multi-dtb in SPL on Unmatched board Date: Wed, 30 Jun 2021 23:23:44 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 30 Jun 2021 17:58:19 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean This patch set contains the support I2C platform EEPROM and multi-dtb mechanism on Unmatched board. There are two revisions of Unmatched with different DDR timing respectively, so we'd like to support multi-dtb in SPL, then it can select the right DTB at runtime according to PCB revision in I2C EEPROM to initialize the right DDR timing. The I2C EEPROM support is refactored based on Paul Welmsley's porting and adopt many suggestions from David Abdurachmanov. Zong Li (6): board: sifive: unmatched: add initial support for a platform ID EEPROM riscv: sifive: fu740: kconfig: Enable support for Opencores I2C controller riscv: sifive: fu740: Support i2c in spl board: sifive: Add an interface to get PCB revision riscv: dts: add dts for unmatched rev1 board: sifive: support spl multi-dtb on unmatched board arch/riscv/cpu/fu740/Kconfig | 3 + arch/riscv/dts/Makefile | 2 +- arch/riscv/dts/fu740-c000-u-boot.dtsi | 4 + .../fu740-hifive-unmatched-a00-ddr-rev1.dtsi | 1489 +++++++++++++++++ .../dts/hifive-unmatched-a00-rev1-u-boot.dtsi | 7 + arch/riscv/dts/hifive-unmatched-a00-rev1.dts | 4 + arch/riscv/include/asm/arch-fu740/eeprom.h | 15 + board/sifive/unmatched/Kconfig | 1 + board/sifive/unmatched/Makefile | 1 + .../unmatched/hifive-platform-i2c-eeprom.c | 574 +++++++ board/sifive/unmatched/spl.c | 28 +- configs/sifive_unmatched_defconfig | 4 + include/configs/sifive-unmatched.h | 6 + 13 files changed, 2135 insertions(+), 3 deletions(-) create mode 100644 arch/riscv/dts/fu740-hifive-unmatched-a00-ddr-rev1.dtsi create mode 100644 arch/riscv/dts/hifive-unmatched-a00-rev1-u-boot.dtsi create mode 100644 arch/riscv/dts/hifive-unmatched-a00-rev1.dts create mode 100644 arch/riscv/include/asm/arch-fu740/eeprom.h create mode 100644 board/sifive/unmatched/hifive-platform-i2c-eeprom.c