public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: slash.tmp@free•fr (Mason)
To: linux-arm-kernel@lists•infradead.org
Subject: Steps to submit a new arch/arm port
Date: Mon, 28 Sep 2015 18:32:05 +0200	[thread overview]
Message-ID: <56096B85.6040002@free.fr> (raw)
In-Reply-To: <56094543.2040101@free.fr>

On 28/09/2015 15:48, Mason wrote:

> But tango_timer_init() is not being called...

Doh! I was using the wrong DTB...

By the way, the command I use to generate uImage feels wrong.
Is there a better way?

$ make dtbs ; make -j2 zImage ; cat arch/arm/boot/zImage arch/arm/boot/dts/tango4.dtb >XXX && mv XXX arch/arm/boot/zImage ; make uImage LOADADDR=0x80008000


My clocksource driver is fairly trivial:

#include <linux/of_address.h>	/* of_iomap			*/
#include <linux/sched_clock.h>	/* sched_clock_register		*/
#include <linux/clocksource.h>	/* clocksource_register_hz	*/
#include <linux/delay.h>	/* register_current_timer_delay	*/

#define XTAL_FREQ		27000000 /* Hz */

static void __iomem *xtal_in_cnt;

static unsigned long read_xtal_counter(void)
{
	return readl_relaxed(xtal_in_cnt);
}

static u64 read_sched_clock(void)
{
	return read_xtal_counter();
}

static cycle_t read_clocksource(struct clocksource *cs)
{
	return read_xtal_counter();
}

static struct clocksource tango_xtal = {
	.name	= "tango_xtal",
	.rating	= 300,
	.read	= read_clocksource,
	.mask	= CLOCKSOURCE_MASK(32),
	.flags	= CLOCK_SOURCE_IS_CONTINUOUS,
};

static struct delay_timer delay_timer = { read_xtal_counter, XTAL_FREQ };

static void __init tango_timer_init(struct device_node *np)
{
	xtal_in_cnt = of_iomap(np, 0);
	register_current_timer_delay(&delay_timer);
	sched_clock_register(read_sched_clock, 32, XTAL_FREQ);
	clocksource_register_hz(&tango_xtal, XTAL_FREQ);
}

CLOCKSOURCE_OF_DECLARE(tango, "sigma,tango-xtal", tango_timer_init);


Regards.

  parent reply	other threads:[~2015-09-28 16:32 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-21 15:00 Steps to submit a new arch/arm port Mason
2015-09-21 15:49 ` Arnd Bergmann
2015-09-22 14:36   ` Mason
2015-09-22 14:51     ` Arnd Bergmann
2015-09-22 14:56       ` Russell King - ARM Linux
2015-09-22 15:54       ` Mason
2015-09-22 16:29         ` Russell King - ARM Linux
2015-09-23  8:49           ` Mason
2015-09-23  9:13             ` Russell King - ARM Linux
2015-09-23  9:21               ` Mason
2015-09-23  9:26                 ` Russell King - ARM Linux
2015-09-22 19:15         ` Arnd Bergmann
2015-09-23  9:26           ` Mason
2015-09-23  9:34             ` Arnd Bergmann
2015-09-25 13:06       ` Mason
2015-09-25 13:17         ` Arnd Bergmann
2015-09-25 13:35           ` Mason
2015-09-25 14:11             ` Arnd Bergmann
2015-09-25 15:28               ` Mason
2015-09-25 15:33                 ` Mason
2015-09-25 15:49                   ` Arnd Bergmann
2015-09-25 15:52                 ` Arnd Bergmann
2015-09-25 16:09                   ` Mason
2015-09-25 17:20                     ` Arnd Bergmann
2015-09-28 13:48       ` Mason
2015-09-28 14:43         ` Måns Rullgård
2015-09-28 16:32         ` Mason [this message]
2015-09-28 17:29           ` Russell King - ARM Linux
2015-09-22 15:48     ` Måns Rullgård
2015-09-25  9:27   ` Mason
2015-09-25  9:46     ` Javier Martinez Canillas
2015-09-25 11:56     ` Arnd Bergmann
2015-09-25 12:06     ` Russell King - ARM Linux
2015-09-21 15:51 ` Måns Rullgård
2015-09-21 16:13 ` Russell King - ARM Linux
2015-09-22 16:08   ` Mason
2015-09-22 16:24     ` Russell King - ARM Linux

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=56096B85.6040002@free.fr \
    --to=slash.tmp@free$(echo .)fr \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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