From patchwork Mon Jul 27 09:19:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 51494 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id E61DC22918 for ; Mon, 27 Jul 2015 09:19:35 +0000 (UTC) Received: by laah7 with SMTP id h7sf25595958laa.2 for ; Mon, 27 Jul 2015 02:19:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=wwYR0yzFI8ANPmQEZr+KtERKjlPOkhF/lvc3mKnjcT8=; b=Z1SpSBcBfC1yzNjCqeOQcejW6hs7Nd2bTqR2G5sQzPEo+cXbMfsNXB1yL1+YI7sP1F 4IoZ0u7gtQiE2YB33/G6TW9CPbNpj1Ylr6adAfySDNjjDO1JGd0DpcE/1iNZeZ7fXH+2 iU8HDd6lXMHBtpb35NNyI0ktY/MHd4A7i7mkfhgX6znHvPot2W6qShoPlLnKwRMHD9ov YUHVz0ktgDDV0y8XfDYvfxmEi8x/Nqwc4HiPNpPDnRI7ekIx4WbGF5pDpzeDQSYV/WsN Jy+450wHb5dHCxfoRMzxOsVtwBJ69WAOws5jmYgb8YWxVWVaqzhLjdvxcWBI9Go80qg7 VGDA== X-Gm-Message-State: ALoCoQnCmk7ZKgPipv0jCy4KEwq1i0PBjXWJokFlWywwDpjNThp2bIN18jrEW1hZDn0NhCQvJjDO X-Received: by 10.112.54.166 with SMTP id k6mr11724271lbp.0.1437988774903; Mon, 27 Jul 2015 02:19:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.10 with SMTP id j10ls633680lae.6.gmail; Mon, 27 Jul 2015 02:19:34 -0700 (PDT) X-Received: by 10.153.7.137 with SMTP id dc9mr25733086lad.16.1437988774753; Mon, 27 Jul 2015 02:19:34 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id u11si13536466lal.142.2015.07.27.02.19.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 02:19:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lblf12 with SMTP id f12so49196453lbl.2 for ; Mon, 27 Jul 2015 02:19:34 -0700 (PDT) X-Received: by 10.152.9.66 with SMTP id x2mr23547083laa.76.1437988774635; Mon, 27 Jul 2015 02:19:34 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1410184lba; Mon, 27 Jul 2015 02:19:33 -0700 (PDT) X-Received: by 10.180.75.78 with SMTP id a14mr22017649wiw.43.1437988772247; Mon, 27 Jul 2015 02:19:32 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id cj8si29683861wjc.164.2015.07.27.02.19.31; Mon, 27 Jul 2015 02:19:32 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F08FD4B61F; Mon, 27 Jul 2015 11:19:30 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G25PaAPHkxYY; Mon, 27 Jul 2015 11:19:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5701F4B615; Mon, 27 Jul 2015 11:19:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A19B74B615 for ; Mon, 27 Jul 2015 11:19:26 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OKXAddkbclrt for ; Mon, 27 Jul 2015 11:19:26 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by theia.denx.de (Postfix) with ESMTPS id 564FF4A03A for ; Mon, 27 Jul 2015 11:19:22 +0200 (CEST) Received: by lblf12 with SMTP id f12so49193269lbl.2 for ; Mon, 27 Jul 2015 02:19:22 -0700 (PDT) X-Received: by 10.152.9.66 with SMTP id x2mr23546526laa.76.1437988762047; Mon, 27 Jul 2015 02:19:22 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by smtp.gmail.com with ESMTPSA id rp10sm3806043lbb.8.2015.07.27.02.19.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jul 2015 02:19:21 -0700 (PDT) From: Linus Walleij To: u-boot@lists.denx.de, Albert Aribaud , Tom Rini Date: Mon, 27 Jul 2015 11:19:16 +0200 Message-Id: <1437988756-16386-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Cc: u-boot-review@google.com Subject: [U-Boot] [PATCH] integrator: switch to DM serial port X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This switches the Integrator boards over to using the device model for its serial ports. Cc: Masahiro Yamada Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Moved CONFIG_DM and CONFIG_DM_SERIAL to Kconfig selects - Moved CONFIG_SYS_MALLOC_F_LEN to Kconfig option --- arch/arm/Kconfig | 2 ++ arch/arm/mach-integrator/Kconfig | 3 +++ board/armltd/integrator/integrator.c | 18 ++++++++++++++++++ include/configs/integrator-common.h | 5 +++++ include/configs/integratorap.h | 11 ----------- include/configs/integratorcp.h | 9 --------- 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 3355b3bcaa58..04006176553c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -457,6 +457,8 @@ config ARCH_HIGHBANK config ARCH_INTEGRATOR bool "ARM Ltd. Integrator family" + select DM + select DM_SERIAL config ARCH_KEYSTONE bool "TI Keystone" diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig index c54d69db0e42..d506ee5b39cd 100644 --- a/arch/arm/mach-integrator/Kconfig +++ b/arch/arm/mach-integrator/Kconfig @@ -53,4 +53,7 @@ config SYS_CONFIG_NAME default "integratorap" if ARCH_INTEGRATOR_AP default "integratorcp" if ARCH_INTEGRATOR_CP +config SYS_MALLOC_F_LEN + default 0x2000 + endmenu diff --git a/board/armltd/integrator/integrator.c b/board/armltd/integrator/integrator.c index e94ac850c751..cbe706170d0f 100644 --- a/board/armltd/integrator/integrator.c +++ b/board/armltd/integrator/integrator.c @@ -20,11 +20,29 @@ #include #include #include +#include +#include #include "arm-ebi.h" #include "integrator-sc.h" DECLARE_GLOBAL_DATA_PTR; +static const struct pl01x_serial_platdata serial_platdata = { + .base = 0x16000000, +#ifdef CONFIG_ARCH_CINTEGRATOR + .type = TYPE_PL011, + .clock = 14745600, +#else + .type = TYPE_PL010, + .clock = 0, /* Not used for PL010 */ +#endif +}; + +U_BOOT_DEVICE(integrator_serials) = { + .name = "serial_pl01x", + .platdata = &serial_platdata, +}; + void peripheral_power_enable (void); #if defined(CONFIG_SHOW_BOOT_PROGRESS) diff --git a/include/configs/integrator-common.h b/include/configs/integrator-common.h index 1d307ca1e6a8..a22efd699c17 100644 --- a/include/configs/integrator-common.h +++ b/include/configs/integrator-common.h @@ -20,6 +20,11 @@ #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size*/ #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 128*1024) /* Size of malloc() pool */ +/* Serial port PL010/PL011 through the device model */ +#define CONFIG_PL01X_SERIAL +#define CONFIG_BAUDRATE 38400 +#define CONFIG_CONS_INDEX 0 + #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ #define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_OF_LIBFDT /* enable passing a Device Tree */ diff --git a/include/configs/integratorap.h b/include/configs/integratorap.h index c76ebcbb60a9..26aa8cadc01d 100644 --- a/include/configs/integratorap.h +++ b/include/configs/integratorap.h @@ -21,17 +21,6 @@ #define CONFIG_SYS_HZ_CLOCK 24000000 /* Timer 1 is clocked at 24Mhz */ /* - * PL010 Configuration - */ -#define CONFIG_PL010_SERIAL -#define CONFIG_CONS_INDEX 0 -#define CONFIG_BAUDRATE 38400 -#define CONFIG_PL01x_PORTS { (void *) (CONFIG_SYS_SERIAL0), (void *) (CONFIG_SYS_SERIAL1) } -#define CONFIG_SYS_SERIAL0 0x16000000 -#define CONFIG_SYS_SERIAL1 0x17000000 - - -/* * BOOTP options */ #define CONFIG_BOOTP_BOOTFILESIZE diff --git a/include/configs/integratorcp.h b/include/configs/integratorcp.h index d6f260287534..4d04f544c815 100644 --- a/include/configs/integratorcp.h +++ b/include/configs/integratorcp.h @@ -28,15 +28,6 @@ #define CONFIG_SMC91111_BASE 0xC8000000 #undef CONFIG_SMC91111_EXT_PHY -/* PL011 configuration */ -#define CONFIG_PL011_SERIAL -#define CONFIG_PL011_CLOCK 14745600 -#define CONFIG_PL01x_PORTS { (void *)CONFIG_SYS_SERIAL0, (void *)CONFIG_SYS_SERIAL1 } -#define CONFIG_CONS_INDEX 0 -#define CONFIG_BAUDRATE 38400 -#define CONFIG_SYS_SERIAL0 0x16000000 -#define CONFIG_SYS_SERIAL1 0x17000000 - /* * Command line configuration. */