[PATCH 5/8] generic_or1k BSP clock driver correction
heshamelmatary at gmail.com
Wed Mar 2 17:01:47 UTC 2016
I reapplied your patches after the include guard issue and it compiles
fine. However, helloworld and ticker samples don't work on either
or1ksim or qemu. Both run fine without your patches applied. Since not
all the users have a hardware platform, RTEMS prefers that each port
runs at least hello and ticker on one or more simulators. So it would
be great if you can test your patches on or1ksim and/or qemu as the
main targets for testing.
There's a readme file at the generic_or1k directory that contains some
instructions how to run the test cases. Also, RTEMS has two other
systems for testing purposes like sim-scripts  which has scripts to
run test cases, and RTEMS Tester  that automates running the whole
500+ tests. or1k port within RTEMS Tester depends on qemu-system-or32
and not or1ksim.
I'd be happy to provide any help if required.
On Wed, Mar 2, 2016 at 11:44 AM, Hesham Almatary
<heshamelmatary at gmail.com> wrote:
> On Tue, Mar 1, 2016 at 2:03 PM, Jakob Viketoft
> <jakob.viketoft at aacmicrotec.com> wrote:
>> From: devel [devel-bounces at rtems.org] on behalf of Hesham Almatary [heshamelmatary at gmail.com]
>> Sent: Saturday, February 27, 2016 19:57
>> To: Jakob Viketoft
>> Cc: rtems-devel at rtems.org
>> Subject: Re: [PATCH 5/8] generic_or1k BSP clock driver correction
>>>On Sat, Feb 20, 2016 at 11:01 PM, <jakob.viketoft at gmail.com> wrote:
>>>> From: Jakob Viketoft <jakob.viketoft at aacmicrotec.com>
>>>> - Improve the clock driver to use RTEMS default tick period
>>>> or the on the one supplied by the application
>>>> - Avoid rewriting the timer settings, since all we need is to clear the interrupt
>>>> - Remove any mention of or1ksim in favour of generic_or1k
>>>> Close #2600
>>>> .../lib/libbsp/or1k/generic_or1k/clock/clockdrv.c | 109 ++++++++++-----------
>>>> 1 file changed, 51 insertions(+), 58 deletions(-)
>>>> diff --git a/c/src/lib/libbsp/or1k/generic_or1k/clock/clockdrv.c b/c/src/lib/libbsp/or1k/generic_or1k/clock/clockdrv.c
>>>> index e01d2e5..60eec98 100644
>>>> --- a/c/src/lib/libbsp/or1k/generic_or1k/clock/clockdrv.c
>>>> +++ b/c/src/lib/libbsp/or1k/generic_or1k/clock/clockdrv.c
>>>> @@ -3,13 +3,15 @@
>>>> * @ingroup bsp_clock
>>>> - * @brief or1k clock support.
>>>> + * @brief generic_or1k clock support.
>>>> * generic_or1k Clock driver
>>>> * COPYRIGHT (c) 2014-2015 Hesham ALMatary <heshamelmatary at gmail.com>
>>>> + * Copyright (c) 2014-2016 ÅAC Microtec AB <www.aacmicrotec.com>
>>>> + * Jakob Viketoft <jakob.viketoft at aacmicrotec.com>
>>>> * The license and distribution terms for this file may be
>>>> * found in the file LICENSE in this distribution or at
>>>> @@ -25,35 +27,30 @@
>>>> #include <rtems/timecounter.h>
>>>> /* The number of clock cycles before generating a tick timer interrupt. */
>>>> -#define TTMR_NUM_OF_CLOCK_TICKS_INTERRUPT 0x09ED9
>>>> -#define OR1K_CLOCK_CYCLE_TIME_NANOSECONDS 10
>>>> +#define OR1K_CLOCK_CYCLE_TIME_NANOSECONDS (1000000000 / OR1K_BSP_CLOCK_FREQ)
>>>clockdrv.c:30:61: error: 'OR1K_BSP_CLOCK_FREQ' undeclared (first use
>>>in this function)
>> Sorry for the delay in responding, it took me a while to figure this one out since I had to build a new toolchain and stuff to make sure I was using same as you. I had rather quickly transfered the change from what we were doing in our own BSP.
> Thanks for doing this.
>> Basically, there is a copy-paste error between the generic_or1k/include/bsp.h and generic_or1k/include/generic_or1k.h include guards which both define the same thing. Change the one in bsp.h and everything compiles as it should. This is somewhat outside this patch's intentions, but should this patch address this as well?
> Great catch. I already have a local fix, if you prefer not to submit a
> patch for this bug separately, I am happy to submit it.
>> Jakob Viketoft
>> Senior Engineer in RTL and embedded software
>> ÅAC Microtec AB
>> Dag Hammarskjölds väg 48
>> SE-751 83 Uppsala, Sweden
>> T: +46 702 80 95 97
More information about the devel