From mboxrd@z Thu Jan 1 00:00:00 1970 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 4699FC433F5 for ; Wed, 8 Dec 2021 15:50:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D084E80FD9; Wed, 8 Dec 2021 16:50:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="A5rkoBMD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7873980FEA; Wed, 8 Dec 2021 16:50:12 +0100 (CET) Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) (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 185A880FD2 for ; Wed, 8 Dec 2021 16:50:08 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=javad321javad@gmail.com Received: by mail-il1-x12b.google.com with SMTP id 15so2570791ilq.2 for ; Wed, 08 Dec 2021 07:50:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VHH/b1OT3iJj7o62CZ2Nn7OrN/LUITrKFM69+wEG7r8=; b=A5rkoBMDhXfxp8dpCe483uWxmRL4ofbtqJldj+7b/F1GB3OaIa8o3EimB6iG6JyCfV pnFiPXiOBZs+vuvN04lnYS+24e3MA9yEIRpW4tHO4pggiya461g5M3k26BjvLg3+KPAf zJn5eKGlWIBRbt6AtOSmd0pfO+WXRaWJ2RXVLv4lz0x96jnIWmWB1kk8gUdKm969xgGk NaxlzZphzmPMHzl5KBtswpJdELybWPoHnMQndGhd96eeeOLcEVpVNoZ8ic83NOXr+Fnp eYDFeRxf8CnMF1O6yGn8NN9zejAIZ+XjTp2wZXCexJ3DT5r4JLm9lZWB/HkPeRm5mSNB e+Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VHH/b1OT3iJj7o62CZ2Nn7OrN/LUITrKFM69+wEG7r8=; b=0+OT6g7enqH9ZJo2OOG7VYvoT5l69z/TNyKPeXPmz1h15Z/5Fmpl2KvZRVNAWgqNHy DKpqaZK3A9juGu0xkGNQvojmJmPzu4cHfqLhArC+XLbk+K06FZAaZ4ToBgiLvTvlrGiT RRClPCJrdjM48FW9vDfeKcikN1BPiG85Xtu1pOtvjaF74GoJABAfL13VZaHGngGPTK33 hSXxMPbdK5FSO4YeqpnLzU6rc7EOny0mM0cWcDdLcxHldipbJVHhxdfz8/e5YarbeXkT uaXw/Jk25EVWqVnu3bAmrfXWPwAiN4uFWSREMXMD70j7Fu4thMbDClq95ORrVMDvONVI ry7g== X-Gm-Message-State: AOAM531SsLy2ZSa04A7fDD/VCg+f3nKSQjVi1HWJg5CLFt1ErGLGQzlX y4oUF+DbryoueabpyvB3QftFgdvfBLzzL+PFpUc= X-Google-Smtp-Source: ABdhPJxC8NKoD9H5kHuZ2dUinZwplKn8WAMrftNkIR1Z4sOWUdfqIImDYOLfJBy60u/YIWF90TXfaqimDHaNetEukUI= X-Received: by 2002:a05:6e02:190b:: with SMTP id w11mr8863813ilu.150.1638978606611; Wed, 08 Dec 2021 07:50:06 -0800 (PST) MIME-Version: 1.0 References: <20211208142238.127247-1-javad321javad@gmail.com> <20211208143456.53b9e996@donnerap.cambridge.arm.com> In-Reply-To: <20211208143456.53b9e996@donnerap.cambridge.arm.com> From: Javad Rahimi Date: Wed, 8 Dec 2021 19:19:55 +0330 Message-ID: Subject: Re: [PATCH v2] Cubieboard2:SUN7I:Add LED BOOT support To: Andre Przywara Cc: Jagan Teki , u-boot@lists.denx.de, hdegoede@redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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 On Wed, Dec 8, 2021 at 6:05 PM Andre Przywara wrote: > > On Wed, 8 Dec 2021 15:25:54 +0100 > Frank Wunderlich wrote: > > Hi, > > > you should add maintainer email for your patch > > > > $ scripts/get_maintainer.pl board/sunxi/board.c > > Jagan Teki (maintainer:ARM SUNXI) > > Andre Przywara (maintainer:ARM SUNXI) > > u-boot@lists.denx.de (open list) > > Thanks Frank! > Hi Andre, Thanks for your comments. I studied the pinephone_defconfig. By default, when activating the same options on Cubieboard2_defconfig it shows linker error for `__led_init` and `__led_set`. In other words, they are not defined. So, in this patch, I added the implementation for these functions for this board. Regards, Javad > > > Gesendet: Mittwoch, 08. Dezember 2021 um 15:22 Uhr > > > Von: "Javad Rahimi" > > > An: u-boot@lists.denx.de > > > Cc: "Javad Rahimi" > > > Betreff: [PATCH v2] Cubieboard2:SUN7I:Add LED BOOT support > > > > > > This feature makes it possible to assign one of > > > LED1(PH20) and LED2(PH21) to BOOT process LED. > > > User should activates the "Enable status LED API" in > > > "Device Drivers -> LED Support" > > Please have a look at the current pinephone_defconfig, because that uses > the boot LED already in a much easier fashion: > https://source.denx.de/u-boot/u-boot/-/commit/0534153fd1 > > Cheers, > Andre > > > > > > > Signed-off-by: Javad Rahimi > > > --- > > > This is my first contributation in open source world. > > > I'm sorry if I have mistakes in my commits and versioning. > > > I do my best to learn fast. > > > > > > Changes in v2: > > > - Missed braces added > > > - Unnecessary debug removed > > > - Some typo fixed > > > > > > board/sunxi/board.c | 49 +++++++++++++++++++++++++++++++++++++++++++++ > > > 1 file changed, 49 insertions(+) > > > > > > diff --git a/board/sunxi/board.c b/board/sunxi/board.c > > > index 4f5747c34a..5e2f6ae902 100644 > > > --- a/board/sunxi/board.c > > > +++ b/board/sunxi/board.c > > > @@ -1002,3 +1002,52 @@ int board_fit_config_name_match(const char *name) > > > return ret; > > > } > > > #endif > > > + > > > +#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT) && defined(CONFIG_LED_STATUS_BOARD_SPECIFIC) > > > + > > > +#define CUBIE2_LED_BOOT_GPIO "PH20" > > > +static int gpio_boot_led; > > > + > > > +void __led_init(led_id_t mask, int state) > > > +{ > > > + int ret; > > > + > > > + if (mask != CONFIG_LED_STATUS_BOOT) > > > + return; > > > + > > > + ret = gpio_lookup_name(CUBIE2_LED_BOOT_GPIO, NULL, NULL, &gpio_boot_led); > > > + > > > + if (ret) > > > + return; > > > + > > > + ret = gpio_request(gpio_boot_led, "boot_led"); > > > + if (ret == -1) { > > > + debug("[gpio_request] Error:%d\n", ret); > > > + return; > > > + } > > > + > > > + ret = gpio_direction_output(gpio_boot_led, 1); > > > + if (ret == -1) { > > > + debug("[gpio_direction_output] Error:%d\n", ret); > > > + return; > > > + } > > > + __led_set(mask, state); > > > +} > > > + > > > +void __led_set(led_id_t mask, int state) > > > +{ > > > + if (mask != CONFIG_LED_STATUS_BOOT) > > > + return; > > > + > > > + gpio_set_value(gpio_boot_led, state); > > > +} > > > + > > > +void __led_toggle(led_id_t mask) > > > +{ > > > + if (mask != CONFIG_LED_STATUS_BOOT) > > > + return; > > > + > > > + gpio_set_value(gpio_boot_led, !gpio_get_value(gpio_boot_led)); > > > +} > > > + > > > +#endif > > > -- > > > 2.25.1 > > > > > > >