mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 02/13] at91: enable clock via clock framework
Date: Wed, 2 Jan 2013 11:58:39 +0100	[thread overview]
Message-ID: <20130102105839.GS24458@pengutronix.de> (raw)
In-Reply-To: <1356722174-22598-2-git-send-email-plagnioj@jcrosoft.com>

On Fri, Dec 28, 2012 at 08:16:03PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> fix at91sam926x timer and dss11
> 
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
>  arch/arm/boards/dss11/init.c          |    6 ++++--
>  arch/arm/mach-at91/at91sam926x_time.c |   23 ++++++++++++++++-------
>  2 files changed, 20 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/boards/dss11/init.c b/arch/arm/boards/dss11/init.c
> index 27c1ec7..12d4263 100644
> --- a/arch/arm/boards/dss11/init.c
> +++ b/arch/arm/boards/dss11/init.c
> @@ -32,8 +32,8 @@
>  #include <mach/sam9_smc.h>
>  #include <gpio.h>
>  #include <mach/io.h>
> -#include <mach/at91_pmc.h>
>  #include <mach/at91_rstc.h>
> +#include <linux/clk.h>
>  
>  static struct atmel_nand_data nand_pdata = {
>  	.ale		= 21,
> @@ -82,7 +82,9 @@ static struct at91_ether_platform_data macb_pdata = {
>  static void dss11_phy_reset(void)
>  {
>  	unsigned long rstc;
> -	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_EMAC);
> +	struct clk *clk = clk_get(NULL, "macb_clk");
> +
> +	clk_enable(clk);
>  
>  	at91_set_gpio_input(AT91_PIN_PA14, 0);
>  	at91_set_gpio_input(AT91_PIN_PA15, 0);
> diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
> index 7425e0a..1ce8d30 100644
> --- a/arch/arm/mach-at91/at91sam926x_time.c
> +++ b/arch/arm/mach-at91/at91sam926x_time.c
> @@ -30,11 +30,11 @@
>  #include <clock.h>
>  #include <asm/hardware.h>
>  #include <mach/at91_pit.h>
> -#include <mach/at91_pmc.h>
>  #include <mach/at91_rstc.h>
>  #include <mach/io.h>
>  #include <io.h>
>  #include <linux/clk.h>
> +#include <linux/err.h>
>  
>  uint64_t at91sam9_clocksource_read(void)
>  {
> @@ -49,15 +49,24 @@ static struct clocksource cs = {
>  
>  static int clocksource_init (void)
>  {
> +	struct clk *clk;
>  	u32 pit_rate;
>  
> -	/*
> -	 * Enable PITC Clock
> -	 * The clock is already enabled for system controller in boot
> -	 */
> -	at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
> +	clk = clk_get(NULL, "mck");
> +	if (IS_ERR(clk)) {
> +		ret = PTR_ERR(clk);
> +		dev_err(dev, "clock not found: %d\n", ret);
> +		return ret;
> +	}

This breaks compilation:

arch/arm/mach-at91/at91sam926x_time.c: In function 'clocksource_init':
arch/arm/mach-at91/at91sam926x_time.c:57:3: error: 'ret' undeclared (first use in this function)
arch/arm/mach-at91/at91sam926x_time.c:57:3: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/mach-at91/at91sam926x_time.c:58:3: error: 'dev' undeclared (first use in this function)

I guess the patch order is wrong.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-01-02 10:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 19:13 [PATCH 00/13] at91: cleanup and switch core driver to device/driver Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 19:16 ` [PATCH 01/13] at91: factorise dbgu address Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 19:16   ` [PATCH 02/13] at91: enable clock via clock framework Jean-Christophe PLAGNIOL-VILLARD
2013-01-02 10:58     ` Sascha Hauer [this message]
2012-12-28 19:16   ` [PATCH 03/13] at91: factoryse PMC address as it's the same on every soc Jean-Christophe PLAGNIOL-VILLARD
2013-01-02 11:00     ` Sascha Hauer
2012-12-28 19:16   ` [PATCH 04/13] at91: pmc: drop AT91_BASE_SYS Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 19:16   ` [PATCH 05/13] at91: introduce Kconfig to select the dbgu for lowlevel debug Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 19:16   ` [PATCH 06/13] at91: sync with the kernel address base Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 19:16   ` [PATCH 07/13] at91: at91sam9: provide its own clkdev for pit Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 19:16   ` [PATCH 08/13] at91: PIT: switch to platfrom_driver Jean-Christophe PLAGNIOL-VILLARD
2013-01-02 10:59     ` Sascha Hauer
2012-12-28 19:16   ` [PATCH 09/13] at91: autodetect the soc one time at postcore_initcall Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 19:16   ` [PATCH 10/13] at91: SMC: switch to platfrom_driver Jean-Christophe PLAGNIOL-VILLARD
2013-01-02 10:59     ` Sascha Hauer
2012-12-28 19:16   ` [PATCH 11/13] at91: wdt: drop AT91_SYS_BASE Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 19:16   ` [PATCH 12/13] at91: introduce AT91SAM9_SMC and AT91SAM9_TIMER Jean-Christophe PLAGNIOL-VILLARD
2012-12-28 19:16   ` [PATCH 13/13] at91: drop AT91_BASE_PIOx for soc specific one for none boot code Jean-Christophe PLAGNIOL-VILLARD
2013-01-02 10:07 ` [PATCH 00/13] at91: cleanup and switch core driver to device/driver Sascha Hauer

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=20130102105839.GS24458@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=plagnioj@jcrosoft.com \
    /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