public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v7 3/7] mips: ath79: add support for QCA953x SOCs
Date: Fri, 22 Jan 2016 15:49:23 +0100	[thread overview]
Message-ID: <201601221549.24061.marex@denx.de> (raw)
In-Reply-To: <BLU436-SMTP209879A56924D1FF41A524AFFC40@phx.gbl>

On Friday, January 22, 2016 at 10:17:25 AM, Wills Wang wrote:
> On Sunday, January 17, 2016 03:33 AM, Marek Vasut wrote:
> > On Saturday, January 16, 2016 at 07:13:49 PM, Wills Wang wrote:
> >> This patch enable work for qca953x SOC.
> >> 
> >> Signed-off-by: Wills Wang <wills.wang@live.com>
> >> ---
> >> 
> >> Changes in v7:
> >> - Use CKSEGxADDR instead of KSEGxADDR for qca953x
> >> 
> >> Changes in v6: None
> >> Changes in v5: None
> >> Changes in v4: None
> >> Changes in v3: None
> >> Changes in v2: None
> > 
> > [...]
> > 
> >> +int get_serial_clock(void)
> >> +{
> >> +	return qca953x_get_xtal();
> >> +}
> >> +
> >> +int get_clocks(void)
> >> +{
> >> +	void __iomem *regs;
> >> +	u32 val, ctrl, xtal, pll, div;
> > 
> > This looks like a copy of the same code in patch 2/7 .
> 
> There are different in detail.
> 
> >> +	regs = map_physmem(AR71XX_PLL_BASE, AR71XX_PLL_SIZE,
> >> +			   MAP_NOCACHE);
> >> +
> >> +	xtal = qca953x_get_xtal();
> >> +	ctrl = readl(regs + QCA953X_PLL_CLK_CTRL_REG);
> >> +	val = readl(regs + QCA953X_PLL_CPU_CONFIG_REG);
> > 
> > [...]
> > 
> >> +void ddr_init(void)
> >> +{
> >> +	void __iomem *regs;
> >> +	u32 val;
> > 
> > This looks like a copy of the same code in patch 2/7 .
> 
> There are different in detail, the bit fields of register are not identical
> copies of one another.

I ran a brief diff, it seems the register file differences can be easily 
handled. The differences in the code are not that great afterward.

> there is no way to extract a common code.
> 
> >> +	regs = map_physmem(AR71XX_DDR_CTRL_BASE, AR71XX_DDR_CTRL_SIZE,
> >> +			   MAP_NOCACHE);
> >> +	val = get_bootstrap();
> >> +	if (val & QCA953X_BOOTSTRAP_DDR1) {
> >> +		writel(DDR_CTL_CONFIG_VAL, regs + QCA953X_DDR_REG_CTL_CONF);
> >> +		udelay(10);
> >> +
> >> +		/* For 16-bit DDR */
> >> +		writel(0xffff, regs + AR71XX_DDR_REG_RD_CYCLE);
> >> +		udelay(100);
> >> +
> >> +		/* Burst size */
> >> +		writel(DDR_BURST_VAL, regs + QCA953X_DDR_REG_BURST);
> >> +		udelay(100);
> >> +		writel(DDR_BURST2_VAL, regs + QCA953X_DDR_REG_BURST2);
> >> +		udelay(100);
> >> +
> >> +		/* AHB maximum timeout */
> >> +		writel(0xfffff, regs + QCA953X_DDR_REG_TIMEOUT_MAX);
> >> +		udelay(100);
> >> +
> >> +		/* DRAM timing */
> >> +		writel(DDR1_CONF_REG_VAL, regs + AR71XX_DDR_REG_CONFIG);
> >> +		udelay(100);
> >> +		writel(DDR1_CONF2_REG_VAL, regs + AR71XX_DDR_REG_CONFIG2);
> >> +		udelay(100);
> >> +		writel(DDR1_CONF3_REG_VAL, regs + QCA953X_DDR_REG_CONFIG3);
> >> +		udelay(100);
> > 
> > [...]

  reply	other threads:[~2016-01-22 14:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1452968033-4460-1-git-send-email-wills.wang@live.com>
2016-01-16 18:13 ` [U-Boot] [PATCH v7 1/7] mips: add base support for QCA/Atheros ath79 SOCs Wills Wang
2016-01-16 19:19   ` Marek Vasut
2016-01-22  9:02     ` Wills Wang
2016-01-22 14:44       ` Marek Vasut
2016-01-23  1:31         ` Wills Wang
2016-01-23  3:06           ` Marek Vasut
2016-01-23  5:25             ` Wills Wang
2016-02-01 19:19   ` Marek Vasut
2016-01-16 18:13 ` [U-Boot] [PATCH v7 2/7] mips: ath79: add support for AR933x SOCs Wills Wang
2016-01-16 19:31   ` Marek Vasut
2016-01-22  9:10     ` Wills Wang
2016-01-22 14:46       ` Marek Vasut
2016-01-16 18:13 ` [U-Boot] [PATCH v7 3/7] mips: ath79: add support for QCA953x SOCs Wills Wang
2016-01-16 19:33   ` Marek Vasut
2016-01-22  9:17     ` Wills Wang
2016-01-22 14:49       ` Marek Vasut [this message]
2016-01-16 18:13 ` [U-Boot] [PATCH v7 4/7] mips: ath79: add serial driver for ar933x SOC Wills Wang
2016-01-16 19:17   ` Daniel Schwierzeck
2016-01-18  3:58   ` Simon Glass
2016-01-16 18:13 ` [U-Boot] [PATCH v7 5/7] mips: ath79: add spi driver Wills Wang
2016-01-16 19:37   ` Daniel Schwierzeck
2016-01-22  9:24     ` Wills Wang
2016-01-27  1:33   ` Marek Vasut
2016-02-02 15:38     ` Wills Wang
2016-02-02 16:07       ` Marek Vasut
2016-01-16 18:13 ` [U-Boot] [PATCH v7 6/7] mips: ath79: add AP121 reference board Wills Wang
2016-01-16 19:50   ` Daniel Schwierzeck
2016-01-22  9:36     ` Wills Wang
2016-01-16 18:13 ` [U-Boot] [PATCH v7 7/7] mips: ath79: add AP143 " Wills Wang
2016-01-16 19:53   ` Daniel Schwierzeck

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=201601221549.24061.marex@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