From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 9/9] mips: ath79: Add support for TPLink WDR4300
Date: Sun, 22 May 2016 04:02:42 +0200 [thread overview]
Message-ID: <57411342.9030605@denx.de> (raw)
In-Reply-To: <BLU436-SMTP1919EF1B0F033E0D236AFDCFF4D0@phx.gbl>
On 05/22/2016 03:49 AM, Wills Wang wrote:
>
>
> On 05/22/2016 12:47 AM, Marek Vasut wrote:
>> On 05/21/2016 06:29 PM, Wills Wang wrote:
>>>
>>> On 05/07/2016 02:10 AM, Marek Vasut wrote:
>>> [...]
>>>> diff --git a/board/tplink/wdr4300/wdr4300.c
>>>> b/board/tplink/wdr4300/wdr4300.c
>>>> new file mode 100644
>>>> index 0000000..6e070fd
>>>> --- /dev/null
>>>> +++ b/board/tplink/wdr4300/wdr4300.c
>>>> @@ -0,0 +1,74 @@
>>>> +/*
>>>> + * Copyright (C) 2016 Marek Vasut <marex@denx.de>
>>>> + *
>>>> + * SPDX-License-Identifier: GPL-2.0+
>>>> + */
>>>> +
>>>> +#include <common.h>
>>>> +#include <asm/io.h>
>>>> +#include <asm/addrspace.h>
>>>> +#include <asm/types.h>
>>>> +#include <mach/ath79.h>
>>>> +#include <mach/ar71xx_regs.h>
>>>> +#include <mach/ddr.h>
>>>> +#include <debug_uart.h>
>>>> +
>>>> +DECLARE_GLOBAL_DATA_PTR;
>>>> +
>>>> +#ifdef CONFIG_USB
>>>> +static void wdr4300_usb_start(void)
>>>> +{
>>>> + void __iomem *gpio_regs = map_physmem(AR71XX_GPIO_BASE,
>>>> + AR71XX_GPIO_SIZE, MAP_NOCACHE);
>>>> + if (!gpio_regs)
>>>> + return;
>>>> +
>>>> + /* Power up the USB HUB. */
>>>> + clrbits_be32(gpio_regs + AR71XX_GPIO_REG_OE, BIT(21) | BIT(22));
>>>> + writel(BIT(21) | BIT(22), gpio_regs + AR71XX_GPIO_REG_SET);
>>>> + mdelay(1);
>>>> +
>>>> + ath79_usb_reset();
>>>> +}
>>>> +#else
>>>> +static inline void wdr4300_usb_start(void) {}
>>>> +#endif
>>>> +
>>>> +#ifdef CONFIG_BOARD_EARLY_INIT_F
>>>> +int board_early_init_f(void)
>>>> +{
>>>> + void __iomem *regs;
>>>> +
>>>> + regs = map_physmem(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE,
>>>> + MAP_NOCACHE);
>>>> +
>>>> + /* Assure JTAG is not disconnected. */
>>>> + writel(0x40, regs + AR934X_GPIO_REG_FUNC);
>>>> +
>>>> + /* Configure default GPIO input/output regs. */
>>>> + writel(0x3031b, regs + AR71XX_GPIO_REG_OE);
>>>> + writel(0x0f804, regs + AR71XX_GPIO_REG_OUT);
>>>> +
>>>> + /* Configure pin multiplexing. */
>>>> + writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC0);
>>>> + writel(0x0b0a0980, regs + AR934X_GPIO_REG_OUT_FUNC1);
>>>> + writel(0x00180000, regs + AR934X_GPIO_REG_OUT_FUNC2);
>>>> + writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC3);
>>>> + writel(0x0000004d, regs + AR934X_GPIO_REG_OUT_FUNC4);
>>>> + writel(0x00000000, regs + AR934X_GPIO_REG_OUT_FUNC5);
>>>> +
>>>> +#ifdef CONFIG_DEBUG_UART
>>>> + debug_uart_init();
>>>> +#endif
>>>> +
>>>> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
>>>> + ar934x_pll_init(560, 480, 240);
>>>> + ar934x_ddr_init(560, 480, 240);
>>>> +#endif
>>> Can we get it to work if CONFIG_SKIP_LOWLEVEL_INIT is defined?
>> Well no, that's what CONFIG_SKIP_LOWLEVEL_INIT is for -- skipping low
>> level initialization of the hardware.
>>
> So, i think this macro definition haveno practical purpose.
>
What do you refer to ? The ifndef ?
The conditional is required when starting the board via JTAG. At that
point, the DRAM is running and reiniting the DRAM would crash U-Boot,
since it is running from that DRAM. So there is very valid use-case for it.
--
Best regards,
Marek Vasut
next prev parent reply other threads:[~2016-05-22 2:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-06 18:10 [U-Boot] [PATCH 1/9] mips: Add MIPS 74Kc tune Marek Vasut
2016-05-06 18:10 ` [U-Boot] [PATCH 2/9] mips: ath79: Fix ar71xx_regs.h indent Marek Vasut
2016-05-06 18:10 ` [U-Boot] [PATCH 3/9] mips: ath79: Fix compiler warning on const assignment Marek Vasut
2016-05-06 18:10 ` [U-Boot] [PATCH 4/9] mips: ath79: dts: Add generic-ehci node Marek Vasut
2016-05-06 18:10 ` [U-Boot] [PATCH V2 5/9] mips: ath79: Add support for ungating USB on ar933x and ar934x Marek Vasut
2016-05-06 18:10 ` [U-Boot] [PATCH V2 6/9] mips: ath79: dts: Add ethernet MAC nodes for ar933x Marek Vasut
2016-05-06 18:10 ` [U-Boot] [PATCH V2 7/9] mips: ath79: Add support for ungating ethernet on ar933x and ar934x Marek Vasut
2016-05-06 18:10 ` [U-Boot] [PATCH V2 8/9] mips: ath79: Add AR934x support Marek Vasut
2016-05-21 16:22 ` Wills Wang
2016-05-21 16:49 ` Marek Vasut
2016-05-22 1:44 ` Wills Wang
2016-05-22 2:14 ` Marek Vasut
2016-05-06 18:10 ` [U-Boot] [PATCH 9/9] mips: ath79: Add support for TPLink WDR4300 Marek Vasut
2016-05-21 16:29 ` Wills Wang
2016-05-21 16:47 ` Marek Vasut
2016-05-22 1:49 ` Wills Wang
2016-05-22 2:02 ` Marek Vasut [this message]
2016-05-08 11:28 ` [U-Boot] [PATCH 1/9] mips: Add MIPS 74Kc tune Daniel Schwierzeck
2016-05-08 11:58 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57411342.9030605@denx.de \
--to=marex@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox