平台AM3352内部RTC
设置硬件时钟以后,系统供电情况下,时钟正常,系统供电无效,单3V电池供电下,时钟保持原来的值,不在走?
请问大神有没有了解的?貌似有说是软件bug,升级就好?从哪里弄升级补丁呢?
附board_AM335xevm.c RTC部分代码
:/*
334 RTC ***************************************************************************
335 */
336 static struct resource am335x_rtc_resources[] = {
337 {
338 .start = AM33XX_RTC_BASE,
339 .end = AM33XX_RTC_BASE + SZ_4K - 1,
340 .flags = IORESOURCE_MEM,
341 },
342 { /* timer irq */
343 .start = AM33XX_IRQ_RTC_TIMER,
344 .end = AM33XX_IRQ_RTC_TIMER,
345 .flags = IORESOURCE_IRQ,
346 },
347 { /* alarm irq */
348 .start = AM33XX_IRQ_RTC_ALARM,
349 .end = AM33XX_IRQ_RTC_ALARM,
350 .flags = IORESOURCE_IRQ,
351 },
352 };
353
354 static struct platform_device am335x_rtc_device = {
355 .name = "omap_rtc",
356 .id = -1,
357 .num_resources = ARRAY_SIZE(am335x_rtc_resources),
358 .resource = am335x_rtc_resources,
359 };
360
361 static int am335x_rtc_init(void)
362 {
363 void __iomem *base;
364 struct clk *clk;
365
366 clk = clk_get(NULL, "rtc_fck");
367 if (IS_ERR(clk)) { if (clk_enable(clk)) {
373 pr_err("rtc: Clock Enable Failed\n");
374 return -1;
375 }
376
377 base = ioremap(AM33XX_RTC_BASE, SZ_4K);
378
379 if (WARN_ON(!base))
380 return -ENOMEM;
381
382 /* Unlock the rtc's registers */
383 __raw_writel(0x83e70b13, base + 0x6c);
384 __raw_writel(0x95a4f1e0, base + 0x70);
385
386 /*
387 * Enable the 32K OSc
388 * TODO: Need a better way to handle this
389 * Since we want the clock to be running before mmc init
390 * we need to do it before the rtc probe happens
391 */
392 __raw_writel(0x48, base + 0x54);
393 iounmap(base);
394
395 return platform_device_register(&am335x_rtc_device);
396 }
368 pr_err("rtc : Failed to get RTC clock\n");
369 return -1;
370 }