• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » ARM® Processors » Sitara™ ARM® » AM3x Sitara ARM Processors Forum » Using 26 MHz oscillator instead of 24 MHz
Share
Sitara™ ARM®
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Using 26 MHz oscillator instead of 24 MHz

Using 26 MHz oscillator instead of 24 MHz

This question is not answered
Qmax
Posted by Qmax
on Apr 03 2012 09:54 AM
Expert2260 points

Hi

To support our board which has a 26 MHz oscillator instead the 24 MHz of the EVM, I've just modified the PLLs N-divisors value in SPL/U-Boot code in arch/arm/include/asm/arch-ti81xx/clocks_am335x.h: 25 instead of 23. Is it enough or do I need further changes?

I'm asking this because everything seemed ok with SDK 5.03 Kernel (PSP 04.06.00.03), which boots with these logs...

[    0.000000] OMAP clockevent source: GPTIMER1 at 26000000 Hz
[    0.000000] OMAP clocksource: GPTIMER2 at 26000000 Hz
[    0.000000] sched_clock: 32 bits at 26MHz, resolution 38ns, wraps every 165191ms

...but after I moved to PSP 04.06.00.06, kernel boots detecting wrong frequency:

[    0.000000] OMAP clockevent source: GPTIMER1 at 24000000 Hz
[    0.000000] OMAP clocksource: GPTIMER2 at 24000000 Hz

I had a quick look at kernel code, file arch/arm/mach-omap2/clock33xx_data.c: in PSP 04.06.00.06 it seems missing something already present in PSP 04.06.00.03 and now present also in git staging tree version, that I think can be related to the issue:

PSP 04.06.00.06:

static struct clk sys_clkin_ck = {
    .name        = "sys_clkin_ck",
    .rate        = 24000000,
    .ops        = &clkops_null,
};

PSP 04.06.00.03 and staging branch:

/* Oscillator clock */
/* 19.2, 24, 25 or 26 MHz */
static const struct clksel sys_clkin_sel[] = {
    { .parent = &virt_19_2m_ck, .rates = div_1_0_rates },
    { .parent = &virt_24m_ck, .rates = div_1_1_rates },
    { .parent = &virt_25m_ck, .rates = div_1_2_rates },
    { .parent = &virt_26m_ck, .rates = div_1_3_rates },
    { .parent = NULL },
};

/* sys_clk_in */
static struct clk sys_clkin_ck = {
    .name        = "sys_clkin_ck",
    .parent        = &virt_24m_ck,
    .init        = &omap2_init_clksel_parent,
    .clksel_reg    = AM33XX_CONTROL_STATUS,
    .clksel_mask    = AM33XX_SYSBOOT1,
    .clksel        = sys_clkin_sel,
    .ops        = &clkops_null,
    .recalc        = &omap2_clksel_recalc,
};

Any suggestion to understand and solve the issue?
Is PSP 04.06.00.06 missing some other specific features already available in previous PSP?

Thanks. Regards,

Max



PSP linux clock u-boot MLO
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • JJD
    Posted by JJD
    on Apr 03 2012 10:10 AM
    Genius9210 points

    Max, you also need to change SYSBOOT[15:14] = 11 on the board.  Refer to table 26-7 in the TRM.  This will allow the ROM and your code to comprehend the correct input frequency.

    Regards,

    James

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Qmax
    Posted by Qmax
    on Apr 03 2012 11:38 AM
    Expert2260 points

    Hi James, thanks for you answer. Yes, of course, this was in charge of my HW colleague, and pins have been pulled-up properly.

    My doubts are related to software because of different behaviours of old and new kernel.

    Regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vaibhav Hiremath
    Posted by Vaibhav Hiremath
    on Apr 03 2012 13:30 PM
    Expert8160 points

    Max,

    There is new release label available which has clean and better implementation of clock tree, I would recommend you to use that branch and let me know how it works for you.

    Release Tag - v3.2_AM335xPSP_04.06.00.07

    Thanks,

    Vaibhav

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Qmax
    Posted by Qmax
    on Apr 10 2012 08:04 AM
    Expert2260 points

    Hi Vaibhav,

    I'm trying kernel on git branch AM335XPSP_04.06.00.07 as you suggested. Now I see:

    [    0.000000] OMAP clockevent source: GPTIMER2 at 26000000 Hz
    [    0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz
    [    0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 131071999ms

    First line now is ok as expected, but I have doubts for next lines. GPTIMER1 previously was at 24 or 26 MHz and now at 32 KHz: resolution is much more lower, which will be the consequences, if any? Do I have to take care of?

    I have an issue building this kernel: am335x-pm-firmware.bin is missing, causing error at build time. I made a quick workaround to build with success, but which are the exact features I have to disable or enable in kernel configuration to avoid this issue? Which is the purpose of this firmware binary file, and where can I get it?

    Thanks in advance for your further help.

    Regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Vaibhav Hiremath
    Posted by Vaibhav Hiremath
    on Apr 11 2012 01:43 AM
    Expert8160 points

    Recently we have added Suspend-To-Ram feature into the kernel, all the issues you are referring above, are due to this new feature addition into the kernel.

    1. GPTIMER1 at 32k

    GPTIMER1 at 32K is expected and its new important change, required from power management support. When you suspend the system, you need atleast system timer keep ticking, right? So we must use 32k clock, we do not have any option here.

    2. Firmware

    This firmware gets loaded into M3, to support power management (suspend-to-ram). You can get the code and pre-built binary at

    http://arago-project.org/git/projects/?p=am33x-cm3.git;a=summary

    Make sure that you copy it into firmware/ directory of your kernel sources and build the kernel again.

    3. How to disable it

    Disable complete PM support from the kernel.

    Thanks,

    Vaibhav

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Qmax
    Posted by Qmax
    on Apr 11 2012 03:16 AM
    Expert2260 points

    Interesting feature: I will evaluate if it can be useful for our product. In case it won't, could I change GPTIMER1 to have a high resolution clock?

    In the meantime I'm trying to build and use kernel without it: I have just unselected SUSPEND (and therefore PM_SLEEP too) in menuconfig and set EXTRA_FIRMWARE to empty string. This is similar to 04.06.00.06 kernel configuration: PM and PM_RUNTIME are still selected (depending on ARCH_OMAP2PLUS_TYPICAL). Is this configuration expected to work? I have a null pointer deference when I rmmod mass storage usb gadget (let me know if you are interested in full log):

    [   46.772961] musb g_mass_storage gadget disconnected.
    [   46.778186] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
    [   46.786642] pgd = cf028000
    [   46.789465] [0000000c] *pgd=8fb76831, *pte=00000000, *ppte=00000000
    [   46.796035] Internal error: Oops: 17 [#1]
    [   46.800221] Modules linked in: g_mass_storage(-)
    [   46.805063] CPU: 0    Not tainted  (3.2.0-dirty #2)
    [   46.810185] PC is at composite_disconnect+0x20/0x60 [g_mass_storage]
    [   46.816832] LR is at composite_disconnect+0x14/0x60 [g_mass_storage]
    [   46.823474] pc : [<bf001b4c>]    lr : [<bf001b40>]    psr: a0000193
    [   46.823485] sp : cf22bc20  ip : cf22bc20  fp : cf22bc34
    [   46.835473] r10: 000000f0  r9 : 00000098  r8 : 00000020
    [   46.840932] r7 : 00000098  r6 : cf9050b8  r5 : a0000193  r4 : 00000000
    [   46.847750] r3 : bf001b2c  r2 : 000010c8  r1 : 00000000  r0 : 00000000
    [   46.854575] Flags: NzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
    [   46.862121] Control: 10c5387d  Table: 8f028019  DAC: 00000015
    [   46.868123] Process rmmod (pid: 1821, stack limit = 0xcf22a2f0)
    [   46.874308] Stack: (0xcf22bc20 to 0xcf22c000)
    [   46.878868] bc20: cf904000 c0608fe0 cf22bc54 cf22bc38 c029bcb4 bf001b38 cf904000 00000001
    ...
    [   47.143926] Backtrace:
    [   47.146529] [<bf001b2c>] (composite_disconnect+0x0/0x60 [g_mass_storage]) from [<c029bcb4>] (musb_g_disconnect+0xb0/0x1cc)
    [   47.158069]  r5:c0608fe0 r4:cf904000
    [   47.161828] [<c029bc04>] (musb_g_disconnect+0x0/0x1cc) from [<c0297374>] (musb_interrupt+0x64c/0x10a4)
    [   47.171551]  r7:c0608a40 r6:c062f918 r5:00000001 r4:cf904000
    [   47.177499] [<c0296d28>] (musb_interrupt+0x0/0x10a4) from [<c02a32c8>] (ti81xx_interrupt+0x268/0x528)
    [   47.187150] [<c02a3060>] (ti81xx_interrupt+0x0/0x528) from [<c006de8c>] (handle_irq_event_percpu+0x58/0x1a4)
    [   47.197428] [<c006de34>] (handle_irq_event_percpu+0x0/0x1a4) from [<c006e008>] (handle_irq_event+0x30/0x40)
    [   47.207618] [<c006dfd8>] (handle_irq_event+0x0/0x40) from [<c006ff24>] (handle_level_irq+0x8c/0x100)
    [   47.217159]  r4:c05d2c24 r3:00020000
    [   47.220911] [<c006fe98>] (handle_level_irq+0x0/0x100) from [<c006d77c>] (generic_handle_irq+0x38/0x48)
    [   47.230633]  r4:c05e2708 r3:c006fe98
    [   47.234401] [<c006d744>] (generic_handle_irq+0x0/0x48) from [<c00150e4>] (handle_IRQ+0x40/0x8c)
    [   47.243501] [<c00150a4>] (handle_IRQ+0x0/0x8c) from [<c0008550>] (omap3_intc_handle_irq+0x50/0x54)
    [   47.252859]  r6:ffffffff r5:cf22bdb0 r4:fa200000 r3:00040000
    [   47.258804] [<c0008500>] (omap3_intc_handle_irq+0x0/0x54) from [<c0013e40>] (__irq_svc+0x40/0x60)
    [   47.268074] Exception stack(0xcf22bdb0 to 0xcf22bdf8)
    [   47.273353] bda0:                                     d081c400 c062f918 00000000 c0295924
    [   47.281904] bdc0: cf904000 d081c500 00000000 c062f918 cf904000 cf904000 d081c400 cf22be2c
    [   47.290453] bde0: cf22bdf8 cf22bdf8 c0296078 c0296080 20000013 ffffffff
    [   47.297361]  r5:20000013 r4:c0296080
    [   47.301118] [<c0295de4>] (musb_restore_context+0x0/0x2e4) from [<c0296108>] (musb_runtime_resume+0x2c/0x34)
    [   47.311319] [<c02960dc>] (musb_runtime_resume+0x0/0x34) from [<c02192f4>] (pm_generic_runtime_resume+0x34/0x48)
    [   47.321876] [<c02192c0>] (pm_generic_runtime_resume+0x0/0x48) from [<c021a664>] (rpm_resume+0x27c/0x4b4)
    [   47.331793] [<c021a3e8>] (rpm_resume+0x0/0x4b4) from [<c021aac8>] (__pm_runtime_resume+0x38/0x50)
    [   47.341075] [<c021aa90>] (__pm_runtime_resume+0x0/0x50) from [<c029ae14>] (musb_gadget_stop+0x200/0x278)
    ...


    Regards

    Max




    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Qmax
    Posted by Qmax
    on Apr 11 2012 03:45 AM
    Expert2260 points

    The error does not depend on SUSPEND: it occurs even if I build kernel with SUSPEND selected.

    And it occurs only on our custom board, and not on AM335x EVM board.

    By the way it does not occur when using PSP 04.06.00.06 kernel: I wonder what it might depend on.

    Regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use