This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTC on I2C of am335x

Other Parts Discussed in Thread: DA8XX, TPS65910

hello ,

         I am trying to access RTC chip based on I2C from AM335x board and using ti-sdk 05.07. Is there is way to change through "" menuconfig "" in linux-devkit Environment or i have to change some thing else.  Do there is more steps to follow .I am facing problem regarding RTC access pls let me know:

Praveen

  • Hello Praveen,

    Which RTC chip (like rx8025) are you using & on which I2C it is connected.

    If you can tell the details, then i will direct you how to get your chip enabled and detected.

    Rajeev Battu

  • Hello Praveen,

    You can enable RTC in menuconfig

    Device Drivers  --->

       [*] Real Time Clock  --->

             <*>   Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025

                              for example if you are using EPSON RX-8025 IC then you should select as above

    And you should add following code in board file in i2c board info structure

    If RTC is connected on i2c0 then  following code should be added with device address--am335x_i2c0_boardinfo

            {
                   I2C_BOARD_INFO("rx8025", 0x32),                    
            },

    Rajeev

  • Hello Rajeev,

                    Thanks for your respons:

                   As per your suggestion when I traverse to :     

                  Device Drivers  --->    [*] Real Time Clock  --->    what I saw is:

                  [ * ]   Set system clock time from RTC on start up and Resume (rtc0) RTC used to set the system time

                  [    ]   RTC debug support

                   *** RTC interface ****

                  [ * ]   /sys/class/rtc/rtcN (sysf)

                  [ * ]  /proc/driver/rtc (procfs for rtc0)

                  [ * ]  /dev/rtcN/ (character device)

                 ...................

                 ...................

                 <   >  Dallas/Maxim DS1307/37/38/39/40, ST M41T00, EPSON RX-8025  

                 ....................

                //  1)  WHY THESE STARS EMBEDDED IN ALL THESE MODULE ? 
             

                        and number of RTC chips I can see SPI and I2C based  but I want use SPI or I2C

                      --In case of 

                   <    > Dallas/Maxima DS1390    

                    2) what steps I  should follow ??  

                    3)what is the file location of   am335x_i2c0_boardinfo{ I2C_BOARD_INFO("rx8085", 0x32); } 

                        I didn't find in board-support/uboot-2013.01.01-psp0505.07.00.00/driver/rtc.

            

    Thank you for Support

    Praveen

                                                                                                            

                  

  • Hi Praveen,


    First tell me which RTC IC are you using & on which I2C it is connected, so that i can guide you correctly.

    < * >is nothing but selecting particular Driver or functionality to be built as static . which means that driver is statically build into kernel, which will be loaded  directly while system is booting.

      One can compile specific devices drivers as modules, so to compile them as modules  <M> is used.  which should be loaded after complete booting of your system.     


    Path for board file is in kernel,

    board-support/linux-3.2.0-psp04.06.00.10/arch/arm/mach-omap2/board-am335xevm.c


    Regards,

    Rajeev Battu

     

  • Dear Rajeev ,

                     Your guidelines are very useful for me thank you for your response.  

    One thing  I want to mention  I found  DS1390 ( SPI based RTC) on my Hardware is connect and I need use that one 1st.

    In Menuconfig I found DS1390 is there in RTC-> SPI column. 

    <  >  Dallas Maxima DS1390

    what step I have to follow from now to use DS1390 and how to control GPIO as it is SPI based RTC .

    Praveen

      

  • Hi Praveen,

    You should select DS1390 by <*> through config "make ARCH=arm menuconfig" which is in 

     [*] Real Time Clock  --->

              [*] Real Time Clock  --->

                      <*>   Dallas/Maxim DS1390/93/94 

    Following code should be added in board file

       arch/arm/mach-omap2/board-am335xevm.c

    I had assumed that you have connected RTC on SPI0

    Check from your side is it so or not, if it is spi1 then add the structure in spi1_board_info[]

    static struct spi_board_info spi0_board_info[] __initdata = { 
       { 
          .modalias   = "rtc-ds1390", 
          .max_speed_hz   = 4000000, 
          .chip_select   = 2, 
       }, 
    };

    Regards,

    Rajeev Battu


  • Hello Rajeev ,

              As I have followed you but how could you say that  writing .chip_select =2 will run.

      how do I get to know writing chip_select = 2 ---> indicating to which pin. It must be linking but how ?

     because initially it is witten  '0'.

    Regards,

    Praveen

  • Hi Praveen,

               Regarding chip select i should have  indicated generic 'X' X maybe CS0,CS1,CS2.

    It depends on hardware pin which you have connected.

    And also check on which SPI have you connected your RTC.

    Regards,

    Rajeev

  • Hello Rajeev,

               I am using SPI0 and using Chip_Select =0 ;

    so as per your advice I have modified the am335x-evm.c file except .Chip_select =0;

    I have modified Menuconfig -->loaded configuration file ---> set DS1390 --> exit --> exit -->  Yes

    As for my satisfaction I checked it is modified.

    # SPI RTC drivers
    #
    # CONFIG_RTC_DRV_M41T93 is not set
    # CONFIG_RTC_DRV_M41T94 is not set
    # CONFIG_RTC_DRV_DS1305 is not set
    CONFIG_RTC_DRV_DS1390=y
    # CONFIG_RTC_DRV_MAX6902 is not set
    # CONFIG_RTC_DRV_R9701 is not set
    # CONFIG_RTC_DRV_RS5C348 is not set
    # CONFIG_RTC_DRV_DS3234 is not set
    # CONFIG_RTC_DRV_PCF2123 is not set

    Then

    write 3 commands---> distclean --->make  am335x_evm_deconfig ---> make uImage during Kernal configuration

    I can see object file is crated a I have attached Image have a look.

    In mid of this pic you can see :

    CC driver/rtc/rtc-ds1390.o

    and so on ....

    My Ques is

    deconfig is modified and even during configuration its shows it is creating rtc-ds1390.o file but while booting it show previous ic configured as rtc0

    in between

    [    1.226165 ] omp_rtc omap_rtc:rtc core :registered omap_rtc as rtc0

    I am not able to configure out pls help

    Regards

    Praveen

  • HI Rajeev,

    when I have did changes as below:

    static struct spi_board_info am335x_spi0_slave_info[] = {
        {
            .modalias      = "rtc-ds1390",
            .platform_data = &am335x_spi_flash,
            .irq           = -1,
            .max_speed_hz  = 4000000,
            .bus_num       = 1,
            .chip_select   = 0,
        },
    };

    in am335x-evm.c file I can able to see something ds1390 as core rtc i:e 


    [  1.26257]  rtc-ds1390 spi1.0: rtc core: registered ds1390 as rtc0    ====>> IS IT SPI --1 or 0

    because it visible spi1.0 I have doubt what is actually means ??

    I have modified in spi0 function and changes occur in spi1 (if it os spi1).


    Next:

    [   1.450378] rtc-ds1390 spi1.0: hctosys: unable to read the hardware

    what might be the reason to able to read??

    IS my cs0 is not connected or not able to communicate or something else ??


    waiting for reply

    Regards

    Praveen

  • Hi Praveen,

         Can you send me kernel log file, i.e.,Debug log on ttyO0

    I will check it.

    Regards,

    Rajeev.

  • Hi Rajeev,

                log  at tty0 .

    ///////////////----------------------------------------LOG ON TTYO0--------------------------------------------------/////////////////////////

       
    U-Boot SPL 2011.09-00040-gec68725-dirty (Sep 03 2012 - 16:31:24)
    Texas Instruments Revision detection unimplemented
    OMAP SD/MMC: 0
    reading u-boot.img
    reading u-boot.img


    U-Boot 2011.09-00040-gec68725-dirty (Sep 03 2012 - 16:31:24)

    I2C:   ready
    DRAM:  256 MiB
    WARNING: Caches not enabled
    NAND:  HW ECC Hamming Code selected
    No NAND device found!!!
    0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Warning - readenv() failed, using default environment

    EVM-Configuration : Calixto-AM335x-EVM

    Net:   cpsw
    Hit any key to stop autoboot:  3 2 1 0
    SD/MMC found on device 0
    reading uEnv.txt

    216 bytes read
    Loaded environment from uEnv.txt
    Importing environment from mmc ...
    Running uenvcmd ...
    reading uImage

    3148824 bytes read
    ## Booting kernel from Legacy Image at 82000000 ...
       Image Name:   Linux-3.2.0
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    3148760 Bytes = 3 MiB
       Load Address: 80008000
       Entry Point:  80008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux... done, booting the kernel.
    [    0.000000] Linux version 3.2.0 (rnd4@ubuntu) (gcc version 4.5.3 20110311 (prerelease) (GCC) ) #1 Fri Oct 4 15:40:11 IST 2013
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine: am335xevm
    [    0.000000] Memory policy: ECC disabled, Data cache writeback
    [    0.000000] AM335X ES1.0 (sgx neon )
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
    [    0.000000] Kernel command line: console=ttyO0,115200n8 mem=256M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait ip=192.168.110.87:::255.255.255.0::eth0:off  
    [    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
    [    0.000000] Memory: 256MB = 256MB total
    [    0.000000] Memory: 253312k/253312k available, 8832k reserved, 0K highmem
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    [    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc05a1000   (5732 kB)
    [    0.000000]       .init : 0xc05a1000 - 0xc05de000   ( 244 kB)
    [    0.000000]       .data : 0xc05de000 - 0xc0636ee0   ( 356 kB)
    [    0.000000]        .bss : 0xc0636f04 - 0xc0663aa4   ( 179 kB)
    [    0.000000] NR_IRQS:396
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [    0.000000] Total of 128 interrupts on 1 active controller
    [    0.000000] OMAP clockevent source: GPTIMER2 at 24000000 Hz
    [    0.000000] OMAP clocksource: GPTIMER1 at 32768 Hz
    [    0.000000] sched_clock: 32 bits at 32kHz, resolution 30517ns, wraps every 131071999ms
    [    0.000000] Console: colour dummy device 80x30
    [    0.000183] Calibrating delay loop... 498.89 BogoMIPS (lpj=2494464)
    [    0.058532] pid_max: default: 32768 minimum: 301
    [    0.058715] Security Framework initialized
    [    0.058837] Mount-cache hash table entries: 512
    [    0.059265] CPU: Testing write buffer coherency: ok
    [    0.080566] omap_hwmod: pruss: failed to hardreset
    [    0.081909] print_constraints: dummy:
    [    0.082366] NET: Registered protocol family 16
    [    0.085174] OMAP GPIO hardware version 0.1
    [    0.088348] omap_mux_init: Add partition: #1: core, flags: 0
    [    0.091125]  omap_i2c.1: alias fck already exists
    [    0.091918] The board is a AM335x Calixto board.
    [    0.092285]  da8xx_lcdc.0: alias fck already exists
    [    0.093048]  omap_hsmmc.0: alias fck already exists
    [    0.093444]  davinci-mcasp.0: alias fck already exists
    [    0.095184]  omap2_mcspi.1: alias fck already exists
    [    0.095489]  omap2_mcspi.2: alias fck already exists
    [    0.095825]  edma.0: alias fck already exists
    [    0.095855]  edma.0: alias fck already exists
    [    0.095886]  edma.0: alias fck already exists
    [    0.125823] bio: create slab <bio-0> at 0
    [    0.128417] SCSI subsystem initialized
    [    0.131042] usbcore: registered new interface driver usbfs
    [    0.131439] usbcore: registered new interface driver hub
    [    0.131713] usbcore: registered new device driver usb
    [    0.131896] musb-ti81xx musb-ti81xx: musb0, board_mode=0x31, plat_mode=0x1
    [    0.132263] musb-ti81xx musb-ti81xx: musb1, board_mode=0x31, plat_mode=0x3
    [    0.133789] omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
    [    0.135284] tps65910 1-002d: JTAGREVNUM 0x0
    [    0.137847] print_constraints: VRTC:
    [    0.139404] print_constraints: VIO: at 1800 mV
    [    0.141876] print_constraints: VDD1: 600 <--> 1500 mV at 1262 mV normal
    [    0.144317] print_constraints: VDD2: 600 <--> 1500 mV at 1137 mV normal
    [    0.145446] print_constraints: VDD3: 5000 mV
    [    0.146942] print_constraints: VDIG1: at 1800 mV
    [    0.148498] print_constraints: VDIG2: at 1800 mV
    [    0.150054] print_constraints: VPLL: at 1800 mV
    [    0.151580] print_constraints: VDAC: at 1800 mV
    [    0.153106] print_constraints: VAUX1: at 1800 mV
    [    0.154663] print_constraints: VAUX2: at 3300 mV
    [    0.156219] print_constraints: VAUX33: at 3300 mV
    [    0.157745] print_constraints: VMMC: at 3300 mV
    [    0.158416] tps65910 1-002d: No interrupt support, no core IRQ
    [    0.159545] Advanced Linux Sound Architecture Driver Version 1.0.24.
    [    0.161254] cfg80211: Calling CRDA to update world regulatory domain
    [    0.162750] Switching to clocksource gp timer
    [    0.184265] musb-hdrc: version 6.0, ?dma?, otg (peripheral+host)
    [    0.184478] musb-hdrc musb-hdrc.0: dma type: pio
    [    0.184875] MUSB0 controller's USBSS revision = 4ea20800
    [    0.185058] musb-hdrc musb-hdrc.0: MUSB HDRC host driver
    [    0.185150] musb-hdrc musb-hdrc.0: new USB bus registered, assigned bus number 1
    [    0.185302] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    0.185333] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    0.185363] usb usb1: Product: MUSB HDRC host driver
    [    0.185363] usb usb1: Manufacturer: Linux 3.2.0 musb-hcd
    [    0.185394] usb usb1: SerialNumber: musb-hdrc.0
    [    0.186401] hub 1-0:1.0: USB hub found
    [    0.186431] hub 1-0:1.0: 1 port detected
    [    0.187133] musb-hdrc musb-hdrc.0: USB Host mode controller at d083c000 using PIO, IRQ 18
    [    0.187347] musb-hdrc musb-hdrc.1: dma type: pio
    [    0.187744] MUSB1 controller's USBSS revision = 4ea20800
    [    0.188446] musb-hdrc musb-hdrc.1: USB OTG mode controller at d083e800 using PIO, IRQ 19
    [    0.188964] NET: Registered protocol family 2
    [    0.189178] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.189575] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
    [    0.189788] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
    [    0.189941] TCP: Hash tables configured (established 8192 bind 8192)
    [    0.189941] TCP reno registered
    [    0.189971] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.190002] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.190216] NET: Registered protocol family 1
    [    0.190551] RPC: Registered named UNIX socket transport module.
    [    0.190582] RPC: Registered udp transport module.
    [    0.190582] RPC: Registered tcp transport module.
    [    0.190582] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.190917] NetWinder Floating Point Emulator V0.97 (double precision)
    [    0.204071] VFS: Disk quotas dquot_6.5.2
    [    0.204162] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [    0.204895] msgmni has been set to 494
    [    0.205871] io scheduler noop registered
    [    0.205902] io scheduler deadline registered
    [    0.205963] io scheduler cfq registered (default)
    [    0.207397] da8xx_lcdc da8xx_lcdc.0: GLCD: Found CALIXTOLCD4 panel
    [    0.213439] Console: switching to colour frame buffer device 40x30
    [    0.218505] omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
    [    0.879974] console [ttyO0] enabled
    [    0.884490] omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
    [    0.892517] omap_uart.2: ttyO2 at MMIO 0x48024000 (irq = 74) is a OMAP UART2
    [    0.900573] omap_uart.3: ttyO3 at MMIO 0x481a6000 (irq = 44) is a OMAP UART3
    [    0.908538] omap_uart.4: ttyO4 at MMIO 0x481a8000 (irq = 45) is a OMAP UART4
    [    0.916534] omap_uart.5: ttyO5 at MMIO 0x481aa000 (irq = 46) is a OMAP UART5
    [    0.937347] brd: module loaded
    [    0.947326] loop: module loaded
    [    0.952362] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    0.959777] omap2-nand driver initializing
    [    0.965820] CAN device driver interface
    [    0.969879] CAN bus driver for Bosch D_CAN controller 1.0
    [    1.023376] davinci_mdio davinci_mdio.0: davinci mdio revision 1.6
    [    1.029907] davinci_mdio davinci_mdio.0: detected phy mask fffffffe
    [    1.037353] davinci_mdio.0: probed
    [    1.040954] davinci_mdio davinci_mdio.0: phy[0]: device 0:00, driver SMSC LAN8710/LAN8720
    [    1.050231] usbcore: registered new interface driver zd1201
    [    1.056549] usbcore: registered new interface driver cdc_ether
    [    1.062927] usbcore: registered new interface driver cdc_eem
    [    1.068969] cdc_ncm: 04-Aug-2011
    [    1.072570] usbcore: registered new interface driver cdc_ncm
    [    1.078857] usbcore: registered new interface driver cdc_acm
    [    1.084869] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    [    1.093536] usbcore: registered new interface driver uas
    [    1.099151] Initializing USB Mass Storage driver...
    [    1.104614] usbcore: registered new interface driver usb-storage
    [    1.110931] USB Mass Storage support registered.
    [    1.116333] usbcore: registered new interface driver usbserial
    [    1.122680] USB Serial support registered for generic
    [    1.128234] usbcore: registered new interface driver usbserial_generic
    [    1.135162] usbserial: USB Serial Driver core
    [    1.140197]  gadget: Gadget Serial v2.4
    [    1.144287]  gadget: g_serial ready
    [    1.147979] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
    [    1.153656] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2
    [    1.161590] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    [    1.168762] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    1.176422] usb usb2: Product: MUSB HDRC host driver
    [    1.181640] usb usb2: Manufacturer: Linux 3.2.0 musb-hcd
    [    1.187255] usb usb2: SerialNumber: musb-hdrc.1
    [    1.193084] hub 2-0:1.0: USB hub found
    [    1.197082] hub 2-0:1.0: 1 port detected
    [    1.201263] ti81xx_interrupt 983: VBUS error workaround (delay coming)
    [    1.209625] mousedev: PS/2 mouse device common for all mice
    [    1.216979] input: ti-tsc-adcc as /devices/platform/omap/tsc/input/input0
    [    1.225830] rtc-ds1390 spi1.0: rtc core: registered ds1390 as rtc0
    [    1.232543] i2c /dev entries driver
    [    1.237640] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [    1.246582] cpuidle: using governor ladder
    [    1.251586] cpuidle: using governor menu
    [    1.261169] usbcore: registered new interface driver usbhid
    [    1.267089] usbhid: USB HID core driver
    [    1.271911] usbcore: registered new interface driver snd-usb-audio
    [    1.281066] _regulator_get: 1-0018 supply IOVDD not found, using dummy regulator
    [    1.289001] _regulator_get: 1-0018 supply DVDD not found, using dummy regulator
    [    1.296783] _regulator_get: 1-0018 supply AVDD not found, using dummy regulator
    [    1.304565] _regulator_get: 1-0018 supply DRVDD not found, using dummy regulator
    [    1.316192] asoc: tlv320aic3x-hifi <-> davinci-mcasp.0 mapping ok
    [    1.324371] ALSA device list:
    [    1.327514]   #0: AM335X EVM
    [    1.330505] oprofile: hardware counters not available
    [    1.335815] oprofile: using timer interrupt.
    [    1.340301] nf_conntrack version 0.5.0 (3958 buckets, 15832 max)
    [    1.347198] ip_tables: (C) 2000-2006 Netfilter Core Team
    [    1.352905] TCP cubic registered
    [    1.356353] NET: Registered protocol family 17
    [    1.360992] can: controller area network core (rev 20090105 abi 8)
    [    1.367645] NET: Registered protocol family 29
    [    1.372344] can: raw protocol (rev 20090105)
    [    1.376861] can: broadcast manager protocol (rev 20090105 t)
    [    1.382873] lib80211: common routines for IEEE802.11 drivers
    [    1.388854] Registering the dns_resolver key type
    [    1.393920] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    1.402008] ThumbEE CPU extension supported.
    [    1.406616] mux: Failed to setup hwmod io irq -22
    [    1.412322] Power Management for AM33XX family
    [    1.417297] Trying to load am335x-pm-firmware.bin (60 secs timeout)
    [    1.424041] Copied the M3 firmware to UMEM
    [    1.432617] clock: disabling unused clocks to save power
    [    1.443878] Detected MACID=0:18:31:e7:2:16
    [    1.449493] cpsw: Detected MACID = 00:18:31:e7:02:17
    [    1.456451] rtc-ds1390 spi1.0: hctosys: unable to read the hardware clock
    [    1.468780] net eth0: CPSW phy found : id is : 0x7c0f1
    [    1.505432] mmc0: host does not support reading read-only switch. assuming write-enable.
    [    1.516693] mmc0: new high speed SD card at address 1234
    [    1.523132] mmcblk0: mmc0:1234 SA02G 1.83 GiB
    [    1.531982]  mmcblk0: p1 p2
    [   96.463958] PHY: 0:00 - Link is Up - 100/Full
    [   96.493682] IP-Config: Complete:
    [   96.497070]      device=eth0, addr=192.168.110.87, mask=255.255.255.0, gw=255.255.255.255,
    [   96.505584]      host=192.168.110.87, domain=, nis-domain=(none),
    [   96.512023]      bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
    [   99.548461] kjournald starting.  Commit interval 5 seconds
    [   99.846893] EXT3-fs (mmcblk0p2): using internal journal
    [   99.852416] EXT3-fs (mmcblk0p2): recovery complete
    [   99.866333] EXT3-fs (mmcblk0p2): mounted filesystem with ordered data mode
    [   99.873657] VFS: Mounted root (ext3 filesystem) on device 179:2.
    [   99.880493] Freeing init memory: 244K

    INIT: version 2.88 booting

    Starting udev
    Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
    bootlogd.
    ALSA: Restoring mixer settings...
    Configuring network interfaces... done.
    hwclock: RTC_RD_TIME: Invalid argument
    Tue Oct  1 00:15:00 UTC 2013

    INIT: Entering runlevel: 5

    Starting system message bus: dbus.
    Starting Dropbear SSH server: dropbear.
    Starting telnet daemon.
    Performing wifi calibration...
    rm: can't remove '/lib/firmware/ti-connectivity/wl1271-nvs.bin': No such file or directory
    Error: Module wl12xx_sdio is not currently loaded
    [  108.002777] wl12xx_sdio: disagrees about version of symbol module_layout
    Error: could not insert module /lib/modules/3.2.0/updates/drivers/net/wireless/wl12xx/wl12xx_sdi[  108.031616] wl12xx_sdio: disagrees about version of symbol module_layout
    o.ko: Invalid module format
    Failed to load kernel module using command /sbin/insmod /lib/modules/3.2.0/updates/drivers/net/wireless/wl12xx/wl12xx_sdio.ko
    Calibration not complete. Removing half-baked nvs
    ERROR: could not insert 'wl12xx_sdio': Exec format error
    hwclock: RTC_RD_TIME: Invalid argument
    Starting network benchmark server: netserver.
    Starting syslogd/klogd: done
    Starting thttpd.
    Starting PVR
    [  108.764862] pvrsrvkm: disagrees about version of symbol module_layout
    Error: could not insert module /lib/modules/3.2.0/kernel/drivers/gpu/pvr/pvrsrvkm.ko: Invalid module format
    Could not find pvrsrvkm driver
    Starting Lighttpd Web Server: lighttpd.
    2013-10-01 00:15:01: (log.c.166) server started
    /
    Starting Matrix GUI application.
    [  111.971801] g_mass_storage: disagrees about version of symbol module_layout
    ERROR: could not insert 'g_mass_storage': Exec format error
    ***************************************************************
    ***************************************************************
    NOTICE: This file system contains the followin GPLv3 packages:
        binutils-symlinks
        binutils
        gdbserver

    If you do not wish to distribute GPLv3 components please remove
    the above packages prior to distribution.  This can be done using
    the opkg remove command.  i.e.:
        opkg remove <package>
    Where <package> is the name printed in the list above

    NOTE: If the package is a dependency of another package you
          will be notified of the dependent packages.  You should
          use the --force-removal-of-dependent-packages option to
          also remove the dependent packages as well
    ***************************************************************
    ***************************************************************
    Stopping Bootlog daemon: bootlogd.
    /etc/init.d/rc: line 176: /usr/bin/psplash-write: cannot execute binary file
    umount: can't umount /mnt/.psplash: Device or resource busy

     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            

    Arago Project http://arago-project.org am335x-evm ttyO0

    Arago 2013.02 am335x-evm ttyO0

    am335x-evm login:

    /////////////////////////////////////////////----------------------------------------------------------///////////////////////////////////////////////

    Regards

    Praveen

  • Hi Praveen,

       Login into unit using Debug port and try following commands

    #hwclock -w

    #date MMDDHHMMYYYY    (MM-MONTH,DD-DATE, HH-HOURS, MM-MINUTES,YYYY-YEARS) 

       Let me know are you able to set date and time.

    Regards,

    Rajeev.

  • Hi Rajeev,

    I am not getting anything after writing #hwclock -w

    as i type #hwclock -r //to show i got an error 

    hwclock: RTC_RD_TIME: Invalid argument;

    I think there is problem in function modification:

    static const struct flash_platform_data am335x_spi_flash = {
        .type      = "sst25vf016b",
        .name      = "spi_flash",
        .parts     = am335x_spi_partitions,
        .nr_parts  = ARRAY_SIZE(am335x_spi_partitions),
    };

    /*
     * SPI Flash works at 80Mhz however SPI Controller works at 48MHz.
     * So setup Max speed to be less than that of Controller speed
     */
    static struct spi_board_info am335x_spi0_slave_info[] = {
        {
            .modalias      = "rtc-ds1390",
        .platform_data = &am335x_spi_flash,    // why this is used as i remove this ds1390 not set as core rtc
            .irq           = -1,
            .max_speed_hz  = 4000000,
            .bus_num       = 0,
            .chip_select   = 1,
        },
    };

    what is this .platform_data  ??

    and what this function am335x_spi_flash do ??  for RTC what argument have to pass and and where we have to modify;

    pls Respond i am not able to access hardware RTC

    while acess from terminal I am getting error hwclock: RTC_RD_TIME: Invalid argument;


    Regards :

    Praveen


     

  • Hi Praveen,

         I am busy with work so i am unable to reply to your query. Are you still facing the problem.

    Have you sorted it out.

    Regards,

    Rajeev

  • Hi Rajeev,

            Thank u  for coming during this period I have learn little bit more.

        Yes Still I have problem. Now the consequence bit changes I cant use :   CS0 and CS1 because the SOM i am using CS0 is connected for SPI_FLASH as u can see in last post;

    and CS1 I am using for Uart3.

    Now Where I am Stuck ---

    --Trying to access spi0 i have modified kernel and am335x--evm.c  file 

    static struct resource am335x_rtc_resources[] = {
        {
            .start        = AM33XX_RTC_BASE,
            .end        = AM33XX_RTC_BASE + SZ_4K - 1,
            .flags        = IORESOURCE_MEM,
        },
        { // timer irq
            .start        = AM33XX_IRQ_RTC_TIMER,
            .end        = AM33XX_IRQ_RTC_TIMER,
            .flags        = IORESOURCE_IRQ,
        },
        { // alarm irq
            .start        = AM33XX_IRQ_RTC_ALARM,
            .end        = AM33XX_IRQ_RTC_ALARM,
            .flags        = IORESOURCE_IRQ,
        },
    };

    static struct platform_device am335x_rtc_device = {
        .name           = "rtc-ds1390",
        .id             = -1,
        .num_resources    = ARRAY_SIZE(am335x_rtc_resources),
        .resource    = am335x_rtc_resources,
    };
    /*
     * SPI Flash works at 80Mhz however SPI Controller works at 48MHz.
     * So setup Max speed to be less than that of Controller speed
     */
    static struct spi_board_info am335x_spi0_slave_info[] = {
        {
            .modalias      = "rtc-ds1390",
            .platform_data = &am335x_rtc_device,
            .irq           = -1,
            .max_speed_hz  = 4000000,
            .bus_num       = 1,
            .chip_select   = 1,
        },
    };

    /////////////////////////////////////LOG FOR RTC ////////////////////////////////////////////////////////

    [    1.217041] input: ti-tsc-adcc as /devices/platform/omap/tsc/input/input0
    [    1.226257] rtc-ds1390 spi1.1: rtc core: registered ds1390 as rtc0
    [    1.232971] i2c /dev entries driver
    [    1.238037] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [    1.247009] cpuidle: using governor ladder
    [    1.251983] cpuidle: using governor menu
    [    1.261596] usbcore: registered new interface driver usbhid
    [    1.267517] usbhid: USB HID core driver
    [    1.272308] usbcore: registered new interface driver snd-usb-audio
    [    1.281463] _regulator_get: 1-0018 supply IOVDD not found, using dummy regulator
    [    1.289428] _regulator_get: 1-0018 supply DVDD not found, using dummy regulator
    [    1.297210] _regulator_get: 1-0018 supply AVDD not found, using dummy regulator
    [    1.304992] _regulator_get: 1-0018 supply DRVDD not found, using dummy regulator
    [    1.316589] asoc: tlv320aic3x-hifi <-> davinci-mcasp.0 mapping ok
    [    1.324829] ALSA device list:
    [    1.328033]   #0: AM335X EVM
    [    1.331054] oprofile: hardware counters not available
    [    1.336425] oprofile: using timer interrupt.
    [    1.340942] nf_conntrack version 0.5.0 (3958 buckets, 15832 max)
    [    1.347839] ip_tables: (C) 2000-2006 Netfilter Core Team
    [    1.353637] TCP cubic registered
    [    1.357055] NET: Registered protocol family 17
    [    1.361755] can: controller area network core (rev 20090105 abi 8)
    [    1.368408] NET: Registered protocol family 29
    [    1.373107] can: raw protocol (rev 20090105)
    [    1.377624] can: broadcast manager protocol (rev 20090105 t)
    [    1.383666] lib80211: common routines for IEEE802.11 drivers
    [    1.389648] Registering the dns_resolver key type
    [    1.394714] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    1.402801] ThumbEE CPU extension supported.
    [    1.407409] mux: Failed to setup hwmod io irq -22
    [    1.413116] Power Management for AM33XX family
    [    1.418090] Trying to load am335x-pm-firmware.bin (60 secs timeout)
    [    1.424835] Copied the M3 firmware to UMEM
    [    1.433471] clock: disabling unused clocks to save power
    [    1.444732] Detected MACID=0:18:31:e7:2:16
    [    1.450347] cpsw: Detected MACID = 00:18:31:e7:02:17
    [    1.457275] rtc-ds1390 spi1.1: hctosys: unable to read the hardware clock
    [    1.470611] net eth0: CPSW phy found : id is : 0x7c0f1

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  

    Q:  I want to know rtc-ds1390 spi1.1: rtc core: registered ds1390 as rtc0  is enabling spi1 or spi0 ?

    Q: As I am using spi0_cs0 and spi0_cs1 for SPI-flash and UART3 can I use any GPIO for chip enable if yes how to use ?

    Regards,

    Praveen

  • Hai Praveen,

          One can use GPIO as chip select in SPI, as i have used in the past. But you should go through the specific driver

    you are developing. better using pin mux get SPI chip select first and clear the problem then you can work around with

    GPIO as chip select will work  

    You can use GPIO as CHIP SELECT.

    If possible ask  calixto team for help.

    Regards,

    Rajeev

  • Hi Rajeev,

          Thanks Alot !!  Now SPI0_CS0 i can able to see clock variation and on SPI0_CLK pin.

    But Still I cant able to access RTC DS1390 . As from console I am trying to access Hardware Clock:

    $ hwclock

    error :hctosys: RTC_RD_TIME invalid argument

    where to set these argument

    Thanks for continuous support;

     

    Regards

    Praveen

  • Hi Praveen,

        We should cross verify the board file for "platform_device am335x_rtc_device"

    i suspect the function

    static struct resource am335x_rtc_resources[] = {
        {
            .start        = AM33XX_RTC_BASE,
            .end        = AM33XX_RTC_BASE + SZ_4K - 1,
            .flags        = IORESOURCE_MEM,
        },

        {
           ......
        },

    }

    Verify the values that are passed as resources & address location.

    Also check for RTC IC, some time RTC IC will get detected but it will not work due to manufacturing defects.

    Regards,

    Rajeev.


  • Hi Rajeev,

    we find the bug the as per your said configuration i did every thing is fine i have cross checked .

    Individually Check CS , MOSI ,SCK pin of AM335x wave are correct and reconnect the pins to DS1390 

      Initially I found RTC_RD_TIME : Invalid argument while booting but after when we checked at console it shows some value after setting from

    :hwclock -w

    it sets the hardware clock;

    After that I have removed Platform_data  and keep all setting as I have mention in previous setting RTC works fine No problem.

    Thanks Alot Rajeev Your Each Post helped Me !!

    Regards

    Praveen

  • Hi Praveen,

        Good to here, that your problem got solved.

    Regards,

    Rajeev