From patchwork Tue Nov 28 02:20:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick Chen X-Patchwork-Id: 841948 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TBRMRFL1"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ym86n2sf1z9sNx for ; Tue, 28 Nov 2017 14:20:01 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 06542C21DA5; Tue, 28 Nov 2017 03:18:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 564BFC21DAB; Tue, 28 Nov 2017 03:18:35 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A5B16C21D56; Tue, 28 Nov 2017 02:44:50 +0000 (UTC) Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by lists.denx.de (Postfix) with ESMTPS id 7F715C21C29 for ; Tue, 28 Nov 2017 02:44:49 +0000 (UTC) Received: by mail-pl0-f66.google.com with SMTP id s23so4464515plk.10 for ; Mon, 27 Nov 2017 18:44:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Fm3jkbHCrLmvpByXkh/GyF5+a23nc2D4wBnoBQbM9kQ=; b=TBRMRFL1HK6Em2CTKCYVQGSZ6LdMWF4mtPpthNm/q0+SK0ak56or0JG+ckNecTgevd /D69igyPuJ9MPtkxHKgp6Kub5KsCQsRj2xDCjJeeXLDGOtixXnPv+0FZeANwcoaUzAbu MRBfOz1HPW9GgFvZ85d5GVSZr4iF/wD6wXeOsb8lpfAYZuFk1xTzkvfjv7MUyAWoc7Ta 9CkQgZcwGUz0HZOGtB7D7N9aDzSM+hFcBGf/7v+2QFbcZDWhs9z8p8E52ZwHaK2sdJ4Q XBoe06ZOrcUAlALgTvLRieXqRfKaVPpBhGDys8ZFuGbrGhlNVAJTEbELjsMFN7s7lMgt h5GA== 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=Fm3jkbHCrLmvpByXkh/GyF5+a23nc2D4wBnoBQbM9kQ=; b=Hx5X3wovavpPVbb17/GVkH45u8fxTwu3SUpzCmemKa9LJ95h/waotDLu4vXTwMEUzA R8kSyL/RnBL+riFOASRZcDkQrYHVYDs9AjlYV8yHghoC5KrItqVVYPPJSaV8tpUrID15 Q+/qJpdoLl2ihzSaYmGFFAbrbiKFkSP1tbSIHOc7vuGJTf49k3biX799dV9ZzkFZfx+A BvAUxO5bCMFchhHafojBpLSufVojQ9J8DHfD4B9G2XEDAmL034zaoBI/TkHy9YHpRYnK 8uhUT/V8L2YCXnwjspxGa7PaqpwiIRg8oeusKhwQRLvkG7adKv9S+KT7D9baZy109S0J I7rQ== X-Gm-Message-State: AJaThX6avoRvA0EXMXpnMzL571W/wHXXTfQCVDgOnEhkAokLS/Mk9JEV XHlXidvCVCu9jkhM+V9XqtRIHQ== X-Google-Smtp-Source: AGs4zMa/3Ig72++S5K3p5Ps4yw5GA9kr0nQtgHG8MA0SiQDABx1MU6QRzSd7yUAuDMZaW8D8iE6Hhg== X-Received: by 10.159.218.66 with SMTP id x2mr40160506plv.326.1511837088053; Mon, 27 Nov 2017 18:44:48 -0800 (PST) Received: from app09.andestech.com ([118.163.51.199]) by smtp.gmail.com with ESMTPSA id o88sm50500034pfj.175.2017.11.27.18.44.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 18:44:47 -0800 (PST) From: Rick Chen To: u-boot@lists.denx.de, wd@denx.de, dzu@denx.de, sjg@chromium.org Date: Tue, 28 Nov 2017 10:20:04 +0800 Message-Id: <1511835607-17682-2-git-send-email-rickchen36@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1511835607-17682-1-git-send-email-rickchen36@gmail.com> References: <1511835607-17682-1-git-send-email-rickchen36@gmail.com> X-Mailman-Approved-At: Tue, 28 Nov 2017 03:18:32 +0000 Subject: [U-Boot] [PATCH v3 1/4] ae3xx: timer: Rename AE3XX to ATCPIT100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion 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" ATCPIT100 is Andestech timer IP which is embeded in AE3XX and AE250 boards. So rename AE3XX to ATCPIT100 will be more make sence. Signed-off-by: rick Signed-off-by: Rick Chen Reviewed-by: Simon Glass --- configs/adp-ae3xx_defconfig | 2 +- drivers/timer/Kconfig | 7 +-- drivers/timer/Makefile | 2 +- drivers/timer/ae3xx_timer.c | 117 ---------------------------------------- drivers/timer/atcpit100_timer.c | 117 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 123 insertions(+), 122 deletions(-) delete mode 100644 drivers/timer/ae3xx_timer.c create mode 100644 drivers/timer/atcpit100_timer.c diff --git a/configs/adp-ae3xx_defconfig b/configs/adp-ae3xx_defconfig index a3a40bf..337cee1 100644 --- a/configs/adp-ae3xx_defconfig +++ b/configs/adp-ae3xx_defconfig @@ -35,4 +35,4 @@ CONFIG_SYS_NS16550=y CONFIG_DM_SPI=y CONFIG_NDS_AE3XX_SPI=y CONFIG_TIMER=y -CONFIG_AE3XX_TIMER=y +CONFIG_ATCPIT100_TIMER=y diff --git a/drivers/timer/Kconfig b/drivers/timer/Kconfig index 6305bbf..fcfdf4e 100644 --- a/drivers/timer/Kconfig +++ b/drivers/timer/Kconfig @@ -105,11 +105,12 @@ config AG101P_TIMER help Select this to enable a timer for AG01P devices. -config AE3XX_TIMER - bool "AE3XX timer support" +config ATCPIT100_TIMER + bool "ATCPIT100 timer support" depends on TIMER && NDS32 help - Select this to enable a timer for AE3XX devices. + Select this to enable a ATCPIT100 timer which will be embeded + in AE3XX, AE250 boards. config ROCKCHIP_TIMER bool "Rockchip timer support" diff --git a/drivers/timer/Makefile b/drivers/timer/Makefile index 69e8961..15e5154 100644 --- a/drivers/timer/Makefile +++ b/drivers/timer/Makefile @@ -13,6 +13,6 @@ obj-$(CONFIG_AST_TIMER) += ast_timer.o obj-$(CONFIG_STI_TIMER) += sti-timer.o obj-$(CONFIG_ARC_TIMER) += arc_timer.o obj-$(CONFIG_AG101P_TIMER) += ag101p_timer.o -obj-$(CONFIG_AE3XX_TIMER) += ae3xx_timer.o +obj-$(CONFIG_ATCPIT100_TIMER) += atcpit100_timer.o obj-$(CONFIG_ROCKCHIP_TIMER) += rockchip_timer.o obj-$(CONFIG_ATMEL_PIT_TIMER) += atmel_pit_timer.o diff --git a/drivers/timer/ae3xx_timer.c b/drivers/timer/ae3xx_timer.c deleted file mode 100644 index b710c28..0000000 --- a/drivers/timer/ae3xx_timer.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Andestech ATCPIT100 timer driver - * - * (C) Copyright 2016 - * Rick Chen, NDS32 Software Engineering, rick@andestech.com - * - * SPDX-License-Identifier: GPL-2.0+ - */ -#include -#include -#include -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -#define REG32_TMR(x) (*(u32 *) ((plat->regs) + (x>>2))) - -/* - * Definition of register offsets - */ - -/* ID and Revision Register */ -#define ID_REV 0x0 - -/* Configuration Register */ -#define CFG 0x10 - -/* Interrupt Enable Register */ -#define INT_EN 0x14 -#define CH_INT_EN(c , i) ((1<platdata; - u32 val; - val = ~(REG32_TMR(CH_CNT(1))+0xffffffff); - *count = timer_conv_64(val); - return 0; -} - -static int atctmr_timer_probe(struct udevice *dev) -{ - struct atftmr_timer_platdata *plat = dev->platdata; - REG32_TMR(CH_REL(1)) = 0xffffffff; - REG32_TMR(CH_CTL(1)) = APB_CLK|TMR_32; - REG32_TMR(CH_EN) |= CH_TMR_EN(1 , 0); - return 0; -} - -static int atctme_timer_ofdata_to_platdata(struct udevice *dev) -{ - struct atftmr_timer_platdata *plat = dev_get_platdata(dev); - plat->regs = map_physmem(devfdt_get_addr(dev) , 0x100 , MAP_NOCACHE); - return 0; -} - -static const struct timer_ops ag101p_timer_ops = { - .get_count = atftmr_timer_get_count, -}; - -static const struct udevice_id ag101p_timer_ids[] = { - { .compatible = "andestech,atcpit100" }, - {} -}; - -U_BOOT_DRIVER(altera_timer) = { - .name = "ae3xx_timer", - .id = UCLASS_TIMER, - .of_match = ag101p_timer_ids, - .ofdata_to_platdata = atctme_timer_ofdata_to_platdata, - .platdata_auto_alloc_size = sizeof(struct atftmr_timer_platdata), - .probe = atctmr_timer_probe, - .ops = &ag101p_timer_ops, - .flags = DM_FLAG_PRE_RELOC, -}; diff --git a/drivers/timer/atcpit100_timer.c b/drivers/timer/atcpit100_timer.c new file mode 100644 index 0000000..b710c28 --- /dev/null +++ b/drivers/timer/atcpit100_timer.c @@ -0,0 +1,117 @@ +/* + * Andestech ATCPIT100 timer driver + * + * (C) Copyright 2016 + * Rick Chen, NDS32 Software Engineering, rick@andestech.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ +#include +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +#define REG32_TMR(x) (*(u32 *) ((plat->regs) + (x>>2))) + +/* + * Definition of register offsets + */ + +/* ID and Revision Register */ +#define ID_REV 0x0 + +/* Configuration Register */ +#define CFG 0x10 + +/* Interrupt Enable Register */ +#define INT_EN 0x14 +#define CH_INT_EN(c , i) ((1<platdata; + u32 val; + val = ~(REG32_TMR(CH_CNT(1))+0xffffffff); + *count = timer_conv_64(val); + return 0; +} + +static int atctmr_timer_probe(struct udevice *dev) +{ + struct atftmr_timer_platdata *plat = dev->platdata; + REG32_TMR(CH_REL(1)) = 0xffffffff; + REG32_TMR(CH_CTL(1)) = APB_CLK|TMR_32; + REG32_TMR(CH_EN) |= CH_TMR_EN(1 , 0); + return 0; +} + +static int atctme_timer_ofdata_to_platdata(struct udevice *dev) +{ + struct atftmr_timer_platdata *plat = dev_get_platdata(dev); + plat->regs = map_physmem(devfdt_get_addr(dev) , 0x100 , MAP_NOCACHE); + return 0; +} + +static const struct timer_ops ag101p_timer_ops = { + .get_count = atftmr_timer_get_count, +}; + +static const struct udevice_id ag101p_timer_ids[] = { + { .compatible = "andestech,atcpit100" }, + {} +}; + +U_BOOT_DRIVER(altera_timer) = { + .name = "ae3xx_timer", + .id = UCLASS_TIMER, + .of_match = ag101p_timer_ids, + .ofdata_to_platdata = atctme_timer_ofdata_to_platdata, + .platdata_auto_alloc_size = sizeof(struct atftmr_timer_platdata), + .probe = atctmr_timer_probe, + .ops = &ag101p_timer_ops, + .flags = DM_FLAG_PRE_RELOC, +}; From patchwork Tue Nov 28 02:20:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick Chen X-Patchwork-Id: 841949 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="q/r+LWPe"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ym86w5ySGz9sNx for ; Tue, 28 Nov 2017 14:20:08 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 80637C21DDB; Tue, 28 Nov 2017 03:19:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 303ECC21DD0; Tue, 28 Nov 2017 03:18:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 84FC7C21D56; Tue, 28 Nov 2017 02:44:51 +0000 (UTC) Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by lists.denx.de (Postfix) with ESMTPS id E66F1C21C29 for ; Tue, 28 Nov 2017 02:44:50 +0000 (UTC) Received: by mail-pl0-f67.google.com with SMTP id s10so9755274plj.5 for ; Mon, 27 Nov 2017 18:44:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Xg4TFMDyq7PCp+08uH18rchY/4UdD5bh4fS6AbhgZKY=; b=q/r+LWPesEkmGaLtN9tbn2ErXFyPC6qCpRPsgOh4LPLi2/Qjiqe3KiuQVIqTIOop3N uYO47ubf3/2YbjfOw050f4dsUAJCsbln9XkfWlqpXiAxAr8lq5xnesgSvZfei4C4s0ab MC61Ba++aHnKdJ2ZrPLS7sCj+bklJ0NzCSjupYaFZQDFRUlhvOSyCcDlKXL1FvNlvb3K 7R69iJb6TTuNU+4V5EmDT6mHbntCmU+E2qavhkydrTKBxlOHzaeeWxzJQrswtunrXSiU hxx9kheQ7LfxJ1ENI6uB+gvMHog68sqgBwNwq42n+RZ10Ep6DS7Oi918oRYAnOPaVMuh fsxA== 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=Xg4TFMDyq7PCp+08uH18rchY/4UdD5bh4fS6AbhgZKY=; b=emd8E5q82aejgDB0h7nAGd9YpOayQtypuwJ8FZDjGcJpmtE2KBetxQecj1N4vfzhCE O12RLtrKkUk+c7Rb/XuYBUudadFHb2To4DVlmXJJGTikAQUfW8jgREkEGP1PLko/KbU5 P+McwwSCf9KjPM1hXR07fpgJuY+pDU0XYBqFeBwPSq3eWGS7G8L5qPzV09rL01lWHA4+ KFR0y5D8TugH2BH22UcUCOx47htJJHQ+U4YUZyoSDEZx0K0cHd+M5kFWmPQ+WpGBXfTx DsR0LnnM7qsNFkymo4r+XdKvvOkLkf9eEyMNQ4zX+pG6/lzC/JkAXFF13Ocw+n/Stggw h5bw== X-Gm-Message-State: AJaThX6k72mI+FdLmWxeTg0vAxggx8iAC8xr9lACnH10tZfs9/RWPiRh sPpKhBIqufoiTKB7bMPx+r4VJw== X-Google-Smtp-Source: AGs4zMaV/95KcfhcoT3/oCaMHpjXYDNtVWMVeAZyj+7b6vh/AU464ryoaBe1cGHo7qakPjQ/z4ItUA== X-Received: by 10.84.168.101 with SMTP id e92mr27810696plb.34.1511837089575; Mon, 27 Nov 2017 18:44:49 -0800 (PST) Received: from app09.andestech.com ([118.163.51.199]) by smtp.gmail.com with ESMTPSA id o88sm50500034pfj.175.2017.11.27.18.44.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 18:44:49 -0800 (PST) From: Rick Chen To: u-boot@lists.denx.de, wd@denx.de, dzu@denx.de, sjg@chromium.org Date: Tue, 28 Nov 2017 10:20:05 +0800 Message-Id: <1511835607-17682-3-git-send-email-rickchen36@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1511835607-17682-1-git-send-email-rickchen36@gmail.com> References: <1511835607-17682-1-git-send-email-rickchen36@gmail.com> X-Mailman-Approved-At: Tue, 28 Nov 2017 03:18:32 +0000 Subject: [U-Boot] [PATCH v3 2/4] cosmetic: atcpit100_timer: Rename function name as atcpit100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion 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" Integrate function and struct name as atcpit100 will be more reasonable. Signed-off-by: rick Signed-off-by: Rick Chen Reviewed-by: Simon Glass --- drivers/timer/atcpit100_timer.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/timer/atcpit100_timer.c b/drivers/timer/atcpit100_timer.c index b710c28..d5146dd 100644 --- a/drivers/timer/atcpit100_timer.c +++ b/drivers/timer/atcpit100_timer.c @@ -67,51 +67,51 @@ struct atctmr_timer_regs { u32 int_mask; /* 0x38 */ }; -struct atftmr_timer_platdata { +struct atcpit_timer_platdata { u32 *regs; }; -static int atftmr_timer_get_count(struct udevice *dev, u64 *count) +static int atcpit_timer_get_count(struct udevice *dev, u64 *count) { - struct atftmr_timer_platdata *plat = dev->platdata; + struct atcpit_timer_platdata *plat = dev->platdata; u32 val; val = ~(REG32_TMR(CH_CNT(1))+0xffffffff); *count = timer_conv_64(val); return 0; } -static int atctmr_timer_probe(struct udevice *dev) +static int atcpit_timer_probe(struct udevice *dev) { - struct atftmr_timer_platdata *plat = dev->platdata; + struct atcpit_timer_platdata *plat = dev->platdata; REG32_TMR(CH_REL(1)) = 0xffffffff; REG32_TMR(CH_CTL(1)) = APB_CLK|TMR_32; REG32_TMR(CH_EN) |= CH_TMR_EN(1 , 0); return 0; } -static int atctme_timer_ofdata_to_platdata(struct udevice *dev) +static int atcpit_timer_ofdata_to_platdata(struct udevice *dev) { - struct atftmr_timer_platdata *plat = dev_get_platdata(dev); + struct atcpit_timer_platdata *plat = dev_get_platdata(dev); plat->regs = map_physmem(devfdt_get_addr(dev) , 0x100 , MAP_NOCACHE); return 0; } -static const struct timer_ops ag101p_timer_ops = { - .get_count = atftmr_timer_get_count, +static const struct timer_ops atcpit_timer_ops = { + .get_count = atcpit_timer_get_count, }; -static const struct udevice_id ag101p_timer_ids[] = { +static const struct udevice_id atcpit_timer_ids[] = { { .compatible = "andestech,atcpit100" }, {} }; -U_BOOT_DRIVER(altera_timer) = { - .name = "ae3xx_timer", +U_BOOT_DRIVER(atcpit100_timer) = { + .name = "atcpit100_timer", .id = UCLASS_TIMER, - .of_match = ag101p_timer_ids, - .ofdata_to_platdata = atctme_timer_ofdata_to_platdata, - .platdata_auto_alloc_size = sizeof(struct atftmr_timer_platdata), - .probe = atctmr_timer_probe, - .ops = &ag101p_timer_ops, + .of_match = atcpit_timer_ids, + .ofdata_to_platdata = atcpit_timer_ofdata_to_platdata, + .platdata_auto_alloc_size = sizeof(struct atcpit_timer_platdata), + .probe = atcpit_timer_probe, + .ops = &atcpit_timer_ops, .flags = DM_FLAG_PRE_RELOC, }; From patchwork Tue Nov 28 02:20:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick Chen X-Patchwork-Id: 841952 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="p6rwttSN"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ym89V0l1nz9sNx for ; Tue, 28 Nov 2017 14:22:22 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id BBA4EC21DE4; Tue, 28 Nov 2017 03:19:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id F2AB4C21DDB; Tue, 28 Nov 2017 03:18:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5C24AC21C4C; Tue, 28 Nov 2017 02:44:53 +0000 (UTC) Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by lists.denx.de (Postfix) with ESMTPS id BF8E8C21D56 for ; Tue, 28 Nov 2017 02:44:52 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id a84so18314768pfl.0 for ; Mon, 27 Nov 2017 18:44:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4mg7mOPQPemOsfOwDgO7ij1qwNRtogDIK6Uuu7WpgKk=; b=p6rwttSNlsuCNA/Ci3J5aiSRCppzeuQMglqtHW5tK0Uwcgquzxw9JmQINCXU1vICA6 rCooIcQZ/V27+Vqnvq9ND3Ls4tVuVDVCN/hNg6M6Sm1L3C3r1wGBTYZmbYXIPDsghUJX OGF49ymkCL/MCJv+cPZcrpjXvRz2IdCEXcPfx1TRiHbDakhlPX82egg6LBs5HL78fLg4 FAexCcMpuzToZb5iAuqVfAMfTmSel070D9Rs9CgklSQaYxVqpNtDcAn1+J1k6dT46uDh 1buMWj44uWPhI8qFJCV6fzwLQkdnom0dRLjV4Gy4gSjFpEIegvEkdp4e3yGTlTAHQIKN 3RzA== 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=4mg7mOPQPemOsfOwDgO7ij1qwNRtogDIK6Uuu7WpgKk=; b=WriOqBA7lxrwk16cGiWWMYdeZl3c2TPti8a7JpQ6XB8OvWnGzW64/tGkhBXw6aKhxi faUs5u4p+ma57b/Z8nbvoSkj+eC4sREeMpmXqxXgrdsQXpDnZJ7125Yo8Ggl4ZHYTt6I LhuJFeynYv7i+YySSjRPbkgFDCBKaR8dTVJMZ4+mgiIYqn8EDr/SnvDoPKtoOkozURHb zDINl2TnpnYOPq7FJXsGdpswyJD8WPB0u8CR6fqqFZqUM+/mjJMY+ldjenthR0ZzBZiE AirywoyFA39LJR+4VpxtLwddDy3UaOGO2YJrLlKCH0jlXJ8ulMCGb7ZqTvbxOYBkzBgx Vs3A== X-Gm-Message-State: AJaThX6PPgFa1h40i8M6HLIArpun6TODiq3Asw2g71KrS4YCAIrGVzhx A8U3LMuwQNFngryaOm++iovGPw== X-Google-Smtp-Source: AGs4zMZGfv2nLoZuSlaqamEpecJEh0Qdgr5J5S28dtGWwVZU5RDRtaX/RAUowuxKEYyKAssEUx/Ppw== X-Received: by 10.99.116.94 with SMTP id e30mr38919088pgn.59.1511837091371; Mon, 27 Nov 2017 18:44:51 -0800 (PST) Received: from app09.andestech.com ([118.163.51.199]) by smtp.gmail.com with ESMTPSA id o88sm50500034pfj.175.2017.11.27.18.44.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 18:44:50 -0800 (PST) From: Rick Chen To: u-boot@lists.denx.de, wd@denx.de, dzu@denx.de, sjg@chromium.org Date: Tue, 28 Nov 2017 10:20:06 +0800 Message-Id: <1511835607-17682-4-git-send-email-rickchen36@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1511835607-17682-1-git-send-email-rickchen36@gmail.com> References: <1511835607-17682-1-git-send-email-rickchen36@gmail.com> X-Mailman-Approved-At: Tue, 28 Nov 2017 03:18:32 +0000 Subject: [U-Boot] [PATCH v3 3/4] cosmetic: atcpit100_timer: Use device api to get platdata X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion 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" Use dev_get_platdata to get private platdata. Signed-off-by: rick Signed-off-by: Rick Chen --- drivers/timer/atcpit100_timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/timer/atcpit100_timer.c b/drivers/timer/atcpit100_timer.c index d5146dd..963f978 100644 --- a/drivers/timer/atcpit100_timer.c +++ b/drivers/timer/atcpit100_timer.c @@ -73,7 +73,7 @@ struct atcpit_timer_platdata { static int atcpit_timer_get_count(struct udevice *dev, u64 *count) { - struct atcpit_timer_platdata *plat = dev->platdata; + struct atcpit_timer_platdata *plat = dev_get_platdata(dev); u32 val; val = ~(REG32_TMR(CH_CNT(1))+0xffffffff); *count = timer_conv_64(val); @@ -82,7 +82,7 @@ static int atcpit_timer_get_count(struct udevice *dev, u64 *count) static int atcpit_timer_probe(struct udevice *dev) { - struct atcpit_timer_platdata *plat = dev->platdata; + struct atcpit_timer_platdata *plat = dev_get_platdata(dev); REG32_TMR(CH_REL(1)) = 0xffffffff; REG32_TMR(CH_CTL(1)) = APB_CLK|TMR_32; REG32_TMR(CH_EN) |= CH_TMR_EN(1 , 0); From patchwork Tue Nov 28 02:20:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick Chen X-Patchwork-Id: 841950 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZkbjFpDO"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3ym88G35Qkz9sPt for ; Tue, 28 Nov 2017 14:21:18 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 1E748C21DB0; Tue, 28 Nov 2017 03:19:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 4A623C21DB2; Tue, 28 Nov 2017 03:18:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 39BDEC21D56; Tue, 28 Nov 2017 02:44:55 +0000 (UTC) Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by lists.denx.de (Postfix) with ESMTPS id 8EB4CC21C29 for ; Tue, 28 Nov 2017 02:44:54 +0000 (UTC) Received: by mail-pg0-f65.google.com with SMTP id c123so19621390pga.11 for ; Mon, 27 Nov 2017 18:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cv5GiNEzm+PCY3hpsC2bUWEH1CXVrLXOeBkN51GtStM=; b=ZkbjFpDOSrfwN/XC3X8x5vtmsU3Qqx7UCaaJI3uuQyTWikHX32tKNclYhM43dhF+Jw lRo4gGh7EBkMAdcNI8xbclvnc92uxx4fy2kCY7AQEWuR0FSeI7rFFjwczVvRNxLP4Exq Kyv3BFqiOdXiKBt1WNEA5Eh1oACpWyN6cIq7pah+1qhniZwaYQhPAfQy5RA/aJnR6PzZ rNaBYa/28pyCE+tEkIuGaMbBOoxQQZCwpSI98bB1v9uZjXVJHWdMKVVxwYB0twJiKQyI xc8vKiaGpfiQ/+v9Zxw/KcW7dBBeElHMEg20sQR0AUrt3J/NjspO0NqbPbu9IdYwipOc N3cQ== 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=cv5GiNEzm+PCY3hpsC2bUWEH1CXVrLXOeBkN51GtStM=; b=fbWTMpguAwjKZXf/J4HUYaBCvFqav2QNuio7pNYhcoRpYVoxNyUuXCaRBegRYl+RgI 5Z/t9JITqgYTIaxOKXNvb2bSzgnwLryCAo7ApTnImVmt9Tq0N1BNA0EcRShfaNul+rkZ 3BnzAfVe9P5l6mUcRnprK2TlLP6E5Q9r2UcHMqTpaCz6ev48kMhH+pxcXQP4IGC79Yb3 l3zenq5FFmEkVAspBiVwck0yslTakyAs35mwP6mIY2mRhd9Oe74YQ/CNSbuc/xq9DDLQ JQHlq9RHZaVpowfXRwtyENYzFcp3nNyS/NCHUeGDYl2R3u9TWNSdJu+5SOV460xWF+SP EvTQ== X-Gm-Message-State: AJaThX4sa9Ek/uSPfmGUHDmE3voWyimbMVkxK3pvF11ToP0yYt5b+Xlt NaSMpfLZfXhCuVlxMsIx31LjxA== X-Google-Smtp-Source: AGs4zMY7VL9aIg4TOegzwEzDN+GR6uZQY5X2camCR23xS+MvEdWyqdhpRBDlhCt8QuU63tBB43Pjsw== X-Received: by 10.101.89.78 with SMTP id g14mr9051821pgu.29.1511837092979; Mon, 27 Nov 2017 18:44:52 -0800 (PST) Received: from app09.andestech.com ([118.163.51.199]) by smtp.gmail.com with ESMTPSA id o88sm50500034pfj.175.2017.11.27.18.44.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 18:44:52 -0800 (PST) From: Rick Chen To: u-boot@lists.denx.de, wd@denx.de, dzu@denx.de, sjg@chromium.org Date: Tue, 28 Nov 2017 10:20:07 +0800 Message-Id: <1511835607-17682-5-git-send-email-rickchen36@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1511835607-17682-1-git-send-email-rickchen36@gmail.com> References: <1511835607-17682-1-git-send-email-rickchen36@gmail.com> X-Mailman-Approved-At: Tue, 28 Nov 2017 03:18:32 +0000 Subject: [U-Boot] [PATCH v3 4/4] dt-bindings: timer: Add andestech atcpit100 timer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion 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" Add a document to describe Andestech atcpit100 timer and binding information. Signed-off-by: rick Signed-off-by: Rick Chen Reviewed-by: Simon Glass --- doc/device-tree-bindings/timer/atcpit100_timer.txt | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 doc/device-tree-bindings/timer/atcpit100_timer.txt diff --git a/doc/device-tree-bindings/timer/atcpit100_timer.txt b/doc/device-tree-bindings/timer/atcpit100_timer.txt new file mode 100644 index 0000000..620814e --- /dev/null +++ b/doc/device-tree-bindings/timer/atcpit100_timer.txt @@ -0,0 +1,31 @@ +Andestech ATCPIT100 timer +------------------------------------------------------------------ +ATCPIT100 is a generic IP block from Andes Technology, embedded in +Andestech AE3XX, AE250 platforms and other designs. + +This timer is a set of compact multi-function timers, which can be +used as pulse width modulators (PWM) as well as simple timers. + +It supports up to 4 PIT channels. Each PIT channel is a +multi-function timer and provide the following usage scenarios: +One 32-bit timer +Two 16-bit timers +Four 8-bit timers +One 16-bit PWM +One 16-bit timer and one 8-bit PWM +Two 8-bit timer and one 8-bit PWM + +Required properties: +- compatible : Should be "andestech,atcpit100" +- reg : Address and length of the register set +- interrupts : Reference to the timer interrupt +- clock-frequency : The rate in HZ in input of the Andestech ATCPIT100 timer + +Examples: + +timer0: timer@f0400000 { + compatible = "andestech,atcpit100"; + reg = <0xf0400000 0x1000>; + interrupts = <2 4>; + clock-frequency = <30000000>; +}: