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 88F9FC46467 for ; Tue, 10 Jan 2023 16:21:12 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6F6DA8559D; Tue, 10 Jan 2023 17:20:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="t2mDtW4o"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C256E8545D; Tue, 10 Jan 2023 17:19:57 +0100 (CET) Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) (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 D35F88545D for ; Tue, 10 Jan 2023 17:19:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-4b718cab0e4so160542077b3.9 for ; Tue, 10 Jan 2023 08:19:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ATLxdY8ksFFT8d7yzEBaEyNPTwhN1f0bBybfO6S1u6w=; b=t2mDtW4oJDMwlMVDl8BV7laTI+8NKNrknUPzEMLyCGHpKyzQdN7SO9ZPovDK8M8A/q 9EXFhokhdTWv8pszRq8Ovfh0R34pcLS8vTBmMt7qoYc1/fn6zyUi4ol7uTBvCmyPRp8x A8ysxL+nWaza+/XUs2t4aTuxY9pd3vzLpd2Nw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ATLxdY8ksFFT8d7yzEBaEyNPTwhN1f0bBybfO6S1u6w=; b=QmFEZ/2AwGi+8eM5vo5Z6g5wh3BNSMhqydNsFQ1AfiN41ia7NUUHiyp1Cs/HSIDmNU C0xxnybBhD9bd5LWHnQlfvNTvNyDGNz2Q8O3q1Le9+rOb+PDeTLtmoGwBn3wsnm+Ticc Xq9jlRRkp5kDdKbx002clah4wNWtgK2+1VpSewmgM2KbTx2EMPQlYKCSwm68+eelrsVY zdyDThuQ1bkbeTCcsyumFDw45cquxTPkUcHDOk5ZWF0rKKoTbj208jfzde5PcGlII23V 16Kd1dxjsTV0plY4Hm5kwWH1dw7tM4uuiqEE0643/L+G2NCtKkxA4/igQJd1DvrUajIY N9Cg== X-Gm-Message-State: AFqh2kqJ+XZJ1XJo1l5ENe2EefNKsxTQsR8lSCAzIxh97ly9xqwDoVeV IIBH4GT3zlzxvHYn8dUgu5AJE75ykCwiSh1UWYM= X-Google-Smtp-Source: AMrXdXua5V+z25mC/sm7RROc/lkNZsYJWagQqASrEZVTRgLNLQqTJ47N0oWZ8ckOZpHGZOLBKuk0gg== X-Received: by 2002:a05:7500:4049:b0:f0:554a:c3f2 with SMTP id r9-20020a057500404900b000f0554ac3f2mr723418gar.10.1673367591308; Tue, 10 Jan 2023 08:19:51 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-2c2f-ce0f-8dee-7136.res6.spectrum.com. [2603:6081:7b00:6400:2c2f:ce0f:8dee:7136]) by smtp.gmail.com with ESMTPSA id d12-20020a05620a240c00b006fcc3858044sm7557110qkn.86.2023.01.10.08.19.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Jan 2023 08:19:50 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Cc: Simon Glass Subject: [PATCH 05/19] dm: ns16550: Change how we get UART_REG to be defined Date: Tue, 10 Jan 2023 11:19:32 -0500 Message-Id: <20230110161946.3816866-5-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110161946.3816866-1-trini@konsulko.com> References: <20230110161946.3816866-1-trini@konsulko.com> MIME-Version: 1.0 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.6 at phobos.denx.de X-Virus-Status: Clean In the case of DM_SERIAL and not having CONFIG_SYS_NS16550_REG_SIZE defined, we would set CONFIG_SYS_NS16550_REG_SIZE to -1 with a comment that this isn't really needed. This implies that the reason we set something here is so that we have UART_REG defined and so can use the rest of the structures that are shared between all the users of ns16650.h. In order to not #define a CONFIG variable here, instead move that check over to the CONFIG_NS16550_DYNAMIC case (which is at the conceptual level, similar to DM) to get UART_REG defined. Cc: Simon Glass Signed-off-by: Tom Rini --- I'm making an assumption, in the end, as to what the DM case is doing. This does work in my lab. --- include/ns16550.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/include/ns16550.h b/include/ns16550.h index 243226fc3d94..2110f00dbf28 100644 --- a/include/ns16550.h +++ b/include/ns16550.h @@ -26,15 +26,8 @@ #include -#if CONFIG_IS_ENABLED(DM_SERIAL) && !defined(CONFIG_SYS_NS16550_REG_SIZE) -/* - * For driver model we always use one byte per register, and sort out the - * differences in the driver - */ -#define CONFIG_SYS_NS16550_REG_SIZE (-1) -#endif - -#if defined(CONFIG_NS16550_DYNAMIC) || defined(CONFIG_DEBUG_UART) +#if (CONFIG_IS_ENABLED(DM_SERIAL) && !defined(CONFIG_SYS_NS16550_REG_SIZE)) || \ + defined(CONFIG_NS16550_DYNAMIC) || defined(CONFIG_DEBUG_UART) #define UART_REG(x) unsigned char x #else #if !defined(CONFIG_SYS_NS16550_REG_SIZE) || (CONFIG_SYS_NS16550_REG_SIZE == 0) -- 2.25.1