Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB724C4338F for ; Tue, 17 Aug 2021 22:01:56 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5A69C6054E for ; Tue, 17 Aug 2021 22:01:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5A69C6054E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5244882D9B; Wed, 18 Aug 2021 00:01:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E3FA282BEC; Wed, 18 Aug 2021 00:00:56 +0200 (CEST) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (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 2267182C6B for ; Wed, 18 Aug 2021 00:00:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tom.rini@gmail.com Received: by mail-qt1-f170.google.com with SMTP id y9so18527061qtv.7 for ; Tue, 17 Aug 2021 15:00:39 -0700 (PDT) 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:in-reply-to :references; bh=6eMVn1l5Vdgt2r1be38ygemosQr0o+0kmqSgDfXvDt0=; b=az7gg0NH933irujIK1UCpCbe6VzhUSQ9/pPkA+PGcUyRYrXZKeN+I36T+5gj/rKsC+ H9lS9k4QzgPiY8zbjbjZ/rro40SS34is6Aye2akRTFgo71en5cptFn8L+GBBY7uHyO7p xA2ec6sL1Q0Ou6pAqBIFWQnSVBDWxobLakz3pRmyGUKW3h+g0c8G3LplhYeo9FplEKym a8nY/KzWKNWHd2L9YrN24uFa9aYSFPUpBxBlEk0fPhUvIxXqMPzHngIse6an5ynMPuIJ UcJTLzYCuNezZX8TxudgVEyOza+pHnozMlIwEkH4npc3XvnpFlhOIrt6NQSa7UZlq11k I25g== X-Gm-Message-State: AOAM532yFCBu7FQt+8491jqX3KiHSQ//WLk2/1QUNZCd/LI7NIULAcLi VydFl8Un1jLVvjZgRuL69b+GS5GvZ9nI X-Google-Smtp-Source: ABdhPJz0KEFfdVOJtmHxoFoMeex3jeFu7pSMVIk+6Gv9ygZPrsebrzUOIDNzoGRgHibf7PKMMNzL4g== X-Received: by 2002:a05:622a:14e:: with SMTP id v14mr5146249qtw.307.1629237637683; Tue, 17 Aug 2021 15:00:37 -0700 (PDT) Received: from bill-the-cat.lan (2603-6081-7b01-cbda-f93a-0b29-d1e6-92fc.res6.spectrum.com. [2603:6081:7b01:cbda:f93a:b29:d1e6:92fc]) by smtp.gmail.com with ESMTPSA id 75sm2270996qko.100.2021.08.17.15.00.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 15:00:37 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Cc: Samuel Egli , Anatolij Gustschin , Heiko Schocher Subject: [PATCH 05/13] siemens: Move CONFIG_SYS_I2C_EEPROM_ADDR usage out of CONFIG namespace Date: Tue, 17 Aug 2021 17:59:40 -0400 Message-Id: <20210817220009.22721-6-trini@konsulko.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210817220009.22721-1-trini@konsulko.com> References: <20210817220009.22721-1-trini@konsulko.com> 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 The instances of CONFIG_SYS_I2C_EEPROM_ADDR on these platforms doesn't match up with the rest of the EERPOM related defines in U-Boot. Move these out of the CONFIG namespace rather than make complex Kconfig logic. Cc: Samuel Egli Cc: Anatolij Gustschin Cc: Heiko Schocher Signed-off-by: Tom Rini --- board/siemens/common/board.c | 3 ++- board/siemens/draco/board.c | 12 ++++++++---- include/configs/draco.h | 4 ---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/board/siemens/common/board.c b/board/siemens/common/board.c index 1bdf404ac3eb..56283660d377 100644 --- a/board/siemens/common/board.c +++ b/board/siemens/common/board.c @@ -70,6 +70,7 @@ void sdram_init(void) #endif /* #ifdef CONFIG_SPL_BUILD */ #ifndef CONFIG_SPL_BUILD +#define FACTORYSET_EEPROM_ADDR 0x50 /* * Basic board specific setup. Pinmux has been handled already. */ @@ -87,7 +88,7 @@ int board_init(void) gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100; #ifdef CONFIG_FACTORYSET - factoryset_read_eeprom(CONFIG_SYS_I2C_EEPROM_ADDR); + factoryset_read_eeprom(FACTORYSET_EEPROM_ADDR); #endif gpmc_init(); diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c index af35bc188e31..f898bba4b0ee 100644 --- a/board/siemens/draco/board.c +++ b/board/siemens/draco/board.c @@ -132,12 +132,16 @@ struct am335x_nand_geometry { u8 nand_bus; }; +#define EEPROM_ADDR 0x50 +#define EEPROM_ADDR_DDR3 0x90 +#define EEPROM_ADDR_CHIP 0x120 + static int draco_read_nand_geometry(void) { struct am335x_nand_geometry geo; /* Read NAND geometry */ - if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, 0x80, 2, + if (i2c_read(EEPROM_ADDR, 0x80, 2, (uchar *)&geo, sizeof(struct am335x_nand_geometry))) { printf("Could not read the NAND geomtery; something fundamentally wrong on the I2C bus.\n"); return -EIO; @@ -160,20 +164,20 @@ static int draco_read_nand_geometry(void) static int read_eeprom(void) { /* Check if baseboard eeprom is available */ - if (i2c_probe(CONFIG_SYS_I2C_EEPROM_ADDR)) { + if (i2c_probe(EEPROM_ADDR)) { printf("Could not probe the EEPROM; something fundamentally wrong on the I2C bus.\n"); return 1; } #ifdef CONFIG_SPL_BUILD /* Read Siemens eeprom data (DDR3) */ - if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_ADDR_DDR3, 2, + if (i2c_read(EEPROM_ADDR, EEPROM_ADDR_DDR3, 2, (uchar *)&settings.ddr3, sizeof(struct ddr3_data))) { printf("Could not read the EEPROM; something fundamentally wrong on the I2C bus.\nUse default DDR3 timings\n"); set_default_ddr3_timings(); } /* Read Siemens eeprom data (CHIP) */ - if (i2c_read(CONFIG_SYS_I2C_EEPROM_ADDR, EEPROM_ADDR_CHIP, 2, + if (i2c_read(EEPROM_ADDR, EEPROM_ADDR_CHIP, 2, (uchar *)&settings.chip, sizeof(settings.chip))) printf("Could not read chip settings\n"); diff --git a/include/configs/draco.h b/include/configs/draco.h index 396eb7ded500..7c1f071d99ec 100644 --- a/include/configs/draco.h +++ b/include/configs/draco.h @@ -32,10 +32,6 @@ /* I2C Configuration */ #define CONFIG_SYS_I2C_SPEED 100000 -#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 -#define EEPROM_ADDR_DDR3 0x90 -#define EEPROM_ADDR_CHIP 0x120 - #define CONFIG_FACTORYSET /* Define own nand partitions */ -- 2.17.1