Re: [uClinux-dev] mcf5307, i2c rtc
Hi all, i received the ds1338-3.3V chip, set up the board.c as Viet suggested below, but still mcf-i2c / rtc-ds1307 drivers don't work. I added some printk in the probe functions, and seeing that both mcfi2c_probe / ds1307_probe are not called in the registration, only the module_init calls are executed for both drivers. Actually, i am not sure if there must be a sequence to register devices. This is the actual dmesg: Linux version 2.6.36.2 (angelo@angel7) (gcc version 4.2.4) #3 Wed Aug 31 15:42:51 CEST 2011 uClinux/COLDFIRE(m5307) COLDFIRE port done by Greg Ungerer, g...@snapgear.com Modified for M5307 by Dave Miller, dmil...@intellistor.com Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne On node 0 totalpages: 4096 free_area_init_node: node 0, pgdat 00197e44, node_mem_map 00234000 DMA zone: 32 pages used for memmap DMA zone: 0 pages reserved DMA zone: 4064 pages, LIFO batch:0 Built 1 zonelists in Zone order, mobility grouping off. Total pages: 4064 Kernel command line: root=/dev/mtdblock3 rootfstype=romfs console=ttyS0,115200 init=/bin/init PID hash table entries: 64 (order: -4, 256 bytes) Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) Memory available: 13988k/16384k RAM, (1446k kernel code, 174k data) SLUB: Genslabs=12, HWalign=16, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 Hierarchical RCU implementation. RCU-based detection of stalled CPUs is disabled. Verbose stalled-CPUs detection is disabled. NR_IRQS:256 Calibrating delay loop... 59.18 BogoMIPS (lpj=295936) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 512 NET: Registered protocol family 16 i2c-core: driver [dummy] registered bio: create slab bio-0 at 0 Switching to clocksource tmr NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 512 (order: 0, 4096 bytes) TCP bind hash table entries: 512 (order: -1, 2048 bytes) TCP: Hash tables configured (established 512 bind 512) TCP reno registered UDP hash table entries: 256 (order: 0, 4096 bytes) UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc. ROMFS MTD (C) 2007 Red Hat, Inc. msgmni has been set to 27 io scheduler noop registered io scheduler deadline registered io scheduler cfq registered (default) ColdFire internal UART serial driver ttyS0 at MMIO 0x11c0 (irq = 73) is a ColdFire UART console [ttyS0] enabled ttyS1 at MMIO 0x1200 (irq = 74) is a ColdFire UART brd: module loaded nbd: registered device at major 43 physmap platform flash device: 0040 at ffc0 physmap-flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0xbf Chip ID 0x00235d number of CFI chips: 1 cmdlinepart partition parsing not available RedBoot partition parsing not available Using physmap partition information Creating 3 MTD partitions on physmap-flash: 0x-0x0002 : U-Boot (128K) 0x0002-0x0030 : Kernel+ROMfs (2994K) 0x0030-0x0040 : JFFS2 (1024K) uclinux[mtd]: RAM probe address=0x1b5748 size=0x7b000 Creating 1 MTD partitions on RAM: 0x-0x0007b000 : ROMfs Generic platform RAM MTD, (c) 2004 Simtec Electronics dm9000 Ethernet Driver, V1.31 Invalid ethernet MAC address. Please set MAC using ifconfig eth0: dm9000e at 3000,3004 IRQ 25 MAC: 00:00:00:00:00:00 (chip) ds1307 module init i2c-core: driver [rtc-ds1307] registered i2c /dev entries driver i2c-core: driver [dev_driver] registered mcfi2c_init TCP cubic registered NET: Registered protocol family 17 drivers/rtc/hctosys.c: unable to open rtc device (rtc0) VFS: Mounted root (romfs filesystem) readonly on device 31:3. Freeing unused kernel memory: 52k freed (0x19c000 - 0x1a8000) eth0: link down eth0: link up, 10Mbps, half-duplex, lpa 0x0021 hope for some help many thanks angelo On 25/08/2011 18:37, Viet Nguyen wrote: On Wed, Aug 24, 2011 at 11:24 PM, angelo angel...@gmail.com mailto:angel...@gmail.com wrote: 1- The device rtc0 must be created from genromfs ? I see some boards that have CONFIG_RTC_HCTOSYS_DEVICE=rtc0 but create a rtc instade, with any number. 2 - Do i hae to add some static structure in my board.c to enable rtc ds1307 driver ? Do you have a sample ? 1. rtc0 device node should be created in order to use hwclock, you don't need to create i2c device note by the way. 2. You must register your platform devices: static struct platform_device rtc_dev_ = { .name = rtc-ds1307, .id = -1, }; static struct resource i2c_res_[] = { { .start = MCFI2C_IOBASE, .end= MCFI2C_IOBASE + MCFI2C_IOSIZE - 1, .flags = IORESOURCE_MEM, }, { .start = MCFINT_VECBASE + MCFINT_I2C, .end= MCFINT_VECBASE + MCFINT_I2C, .flags = IORESOURCE_IRQ, }, };
[uClinux-dev] Re: [PATCH 2/4] TTY: serial, remove dead code from 68328
On Wed, Aug 31, 2011 at 21:51, Geert Uytterhoeven ge...@linux-m68k.org wrote: On Wed, Aug 31, 2011 at 21:24, Jiri Slaby jsl...@suse.cz wrote: The code is dead at least since 2002. So remove it to not distort git grep output (about port.tty usage). Remove the whole do_softirq tasklet as it's noop now. Signed-off-by: Jiri Slaby jsl...@suse.cz Cc: Geert Uytterhoeven ge...@linux-m68k.org Cc: Alan Cox a...@linux.intel.com --- Cc: linux-m...@lists.linux-m68k.org This is a uClinux driver. So I really wanted to cc the uClinux list... drivers/tty/serial/68328serial.c | 35 --- drivers/tty/serial/68328serial.h | 1 - 2 files changed, 0 insertions(+), 36 deletions(-) diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c index e0a7754..f549231 100644 --- a/drivers/tty/serial/68328serial.c +++ b/drivers/tty/serial/68328serial.c @@ -235,22 +235,6 @@ static void batten_down_hatches(void) static void status_handle(struct m68k_serial *info, unsigned short status) { -#if 0 - if(status DCD) { - if((info-port.tty-termios-c_cflag CRTSCTS) - ((info-curregs[3] AUTO_ENAB)==0)) { - info-curregs[3] |= AUTO_ENAB; - info-pendregs[3] |= AUTO_ENAB; - write_zsreg(info-m68k_channel, 3, info-curregs[3]); - } - } else { - if((info-curregs[3] AUTO_ENAB)) { - info-curregs[3] = ~AUTO_ENAB; - info-pendregs[3] = ~AUTO_ENAB; - write_zsreg(info-m68k_channel, 3, info-curregs[3]); - } - } -#endif /* If this is console input and this is a * 'break asserted' status change interrupt * see if we can drop into the debugger @@ -340,9 +324,6 @@ static void transmit_chars(struct m68k_serial *info) info-xmit_tail = info-xmit_tail (SERIAL_XMIT_SIZE-1); info-xmit_cnt--; - if (info-xmit_cnt WAKEUP_CHARS) - schedule_work(info-tqueue); - if(info-xmit_cnt = 0) { /* All done for now... TX ints off */ uart-ustcnt = ~USTCNT_TX_INTR_MASK; @@ -378,21 +359,6 @@ irqreturn_t rs_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static void do_softint(struct work_struct *work) -{ - struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue); - struct tty_struct *tty; - - tty = info-tty; - if (!tty) - return; -#if 0 - if (clear_bit(RS_EVENT_WRITE_WAKEUP, info-event)) { - tty_wakeup(tty); - } -#endif -} - static int startup(struct m68k_serial * info) { m68328_uart *uart = uart_addr[info-line]; @@ -1324,7 +1290,6 @@ rs68328_init(void) info-event = 0; info-count = 0; info-blocked_open = 0; - INIT_WORK(info-tqueue, do_softint); init_waitqueue_head(info-open_wait); init_waitqueue_head(info-close_wait); info-line = i; diff --git a/drivers/tty/serial/68328serial.h b/drivers/tty/serial/68328serial.h index 8c9c3c0..3d2faab 100644 --- a/drivers/tty/serial/68328serial.h +++ b/drivers/tty/serial/68328serial.h @@ -158,7 +158,6 @@ struct m68k_serial { int xmit_head; int xmit_tail; int xmit_cnt; - struct work_struct tqueue; wait_queue_head_t open_wait; wait_queue_head_t close_wait; }; -- 1.7.6.1 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say programmer or something like that. -- Linus Torvalds ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] mcf5307, i2c rtc
Hi all, i found an error in my resources struct, and i finally have the driver set loaded, Still seems i cannot get valid bytes from RTC ds1338. I probably have some HW issue. i2c i2c-0: master_xfer[0] W, addr=0x68, len=1 i2c i2c-0: master_xfer[1] R, addr=0x68, len=7 rtc-ds1307 0-0068: read: 00 00 00 00 00 00 00 rtc-ds1307 0-0068: read secs=0, mins=0, hours=0, mday=0, mon=-1, year=100, wday=-1 rtc-ds1307 0-0068: hctosys: unable to read the hardware clock many thanks to Steven for the driver, and many thanks to all for the help until now, regards, angelo On 25/08/2011 18:37, Viet Nguyen wrote: On Wed, Aug 24, 2011 at 11:24 PM, angelo angel...@gmail.com mailto:angel...@gmail.com wrote: 1- The device rtc0 must be created from genromfs ? I see some boards that have CONFIG_RTC_HCTOSYS_DEVICE=rtc0 but create a rtc instade, with any number. 2 - Do i hae to add some static structure in my board.c to enable rtc ds1307 driver ? Do you have a sample ? 1. rtc0 device node should be created in order to use hwclock, you don't need to create i2c device note by the way. 2. You must register your platform devices: static struct platform_device rtc_dev_ = { .name = rtc-ds1307, .id = -1, }; static struct resource i2c_res_[] = { { .start = MCFI2C_IOBASE, .end= MCFI2C_IOBASE + MCFI2C_IOSIZE - 1, .flags = IORESOURCE_MEM, }, { .start = MCFINT_VECBASE + MCFINT_I2C, .end= MCFINT_VECBASE + MCFINT_I2C, .flags = IORESOURCE_IRQ, }, }; static struct platform_device i2c_dev_ = { .name = mcfi2c, .id = 0, .num_resources = ARRAY_SIZE(i2c_res_), .resource = i2c_res_, }; static struct i2c_board_info __initdata i2c_info_[] = { { I2C_BOARD_INFO(ds1338, 0x68), }, }; static struct platform_device *devices_[] __initdata = { rtc_dev_, i2c_dev_, }; ... in your arch_init: i2c_register_board_info(0, i2c_info_, ARRAY_SIZE(i2c_info_)); platform_add_devices(devices_, ARRAY_SIZE(devices_)); PS: I used i2c driver of Steven King Regrads, -- Nguyen Quoc Viet ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
[uClinux-dev] Cross compiling uClinux 2.4.x for arm-nommu arch
Hello. I am trying to cross-compile uClinux kernel 2.4.x for the Atmel AT91 board. I AM able to compile uClinux 2.6.x successfully for the Atmel board; however, I need 2.4.x to compile. Compiling 2.6.x I simply set CROSS_COMPILE in the menuconfig and went about my way. It appears less straightforward in the 2.4.x build. To override the hard-coded CROSS_COMPILE and KERNEL_CROSS_COMPILE I modified uClinux-dist/vendors/config/armnommu.arch so I could override the cross compilation variables. Then I ran: CROSS_COMPILE=/usr/local/arm-uclinux-gcc-3.4.3/bin/arm-uclinux-elf- KERNEL_CROSS_COMPILE=/usr/local/arm-uclinux-gcc-3.4.3/bin/arm-uclinux-elf- make linux Where: ls /usr/local/arm-uclinux-gcc-3.4.3/bin/ arm-elf-addr2line arm-elf-flthdr arm-elf-objcopy arm-uclinux-elf-addr2line arm-uclinux-elf-flthdr arm-uclinux-elf-ld arm-uclinux-elf-run arm-elf-ar arm-elf-g++ arm-elf-objdump arm-uclinux-elf-ar arm-uclinux-elf-g++arm-uclinux-elf-ld.real arm-uclinux-elf-size arm-elf-as arm-elf-gcc arm-elf-ranlib arm-uclinux-elf-as arm-uclinux-elf-gccarm-uclinux-elf-nm arm-uclinux-elf-strings arm-elf-c++arm-elf-gcov arm-elf-readelf arm-uclinux-elf-c++ arm-uclinux-elf-gcc-3.4.3 arm-uclinux-elf-objcopy arm-uclinux-elf-strip arm-elf-c++filtarm-elf-ld arm-elf-size arm-uclinux-elf-c++filt arm-uclinux-elf-gccbug arm-uclinux-elf-objdump genromfs arm-elf-cpparm-elf-ld.real arm-elf-strings arm-uclinux-elf-cpp arm-uclinux-elf-gcov arm-uclinux-elf-ranlib arm-elf-elf2fltarm-elf-nm arm-elf-striparm-uclinux-elf-elf2flt arm-uclinux-elf-gdbarm-uclinux-elf-readelf Am I using the wrong toolchain version? So far I haven't found anything for sure specifying a specific version of the gnu arm-uclinux compiler toolset for uClinux kernel 2.4.x. I may just be missing it. The error I see appears to start with the compilation of assembly units: /usr/local/arm-uclinux-gcc-3.4.3//bin/arm-uclinux-elf-gcc -D__ASSEMBLY__ -D__KERNEL__ -I/home/Virtual_Machines/linux_kernels/uClinux-dist/linux-2.4.x/include -DNO_MM -mapcs-32 -march=armv4 -msoft-float -c -o entry-armv.o entry-armv.S entry-armv.S: Assembler messages: entry-armv.S:1495: Warning: destination register same as write-back base entry-armv.S:1721: Error: undefined symbol TSS_FPESAVE used as an immediate value The above text is the first error. There are many more assembly errors. Any help would be appreciated. ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] Cross compiling uClinux 2.4.x for arm-nommu arch
Hi Brent, On 01/09/11 09:55, Brent Weatherall wrote: Hello. I am trying to cross-compile uClinux kernel 2.4.x for the Atmel AT91 board. I AM able to compile uClinux 2.6.x successfully for the Atmel board; however, I need 2.4.x to compile. What code base are you working from? Which version of uClinux-dist? Regards Greg Compiling 2.6.x I simply set CROSS_COMPILE in the menuconfig and went about my way. It appears less straightforward in the 2.4.x build. To override the hard-coded CROSS_COMPILE and KERNEL_CROSS_COMPILE I modified uClinux-dist/vendors/config/armnommu.arch so I could override the cross compilation variables. Then I ran: CROSS_COMPILE=/usr/local/arm-uclinux-gcc-3.4.3/bin/arm-uclinux-elf- KERNEL_CROSS_COMPILE=/usr/local/arm-uclinux-gcc-3.4.3/bin/arm-uclinux-elf- make linux Where: ls /usr/local/arm-uclinux-gcc-3.4.3/bin/ arm-elf-addr2line arm-elf-flthdr arm-elf-objcopy arm-uclinux-elf-addr2line arm-uclinux-elf-flthdr arm-uclinux-elf-ld arm-uclinux-elf-run arm-elf-ar arm-elf-g++ arm-elf-objdump arm-uclinux-elf-ar arm-uclinux-elf-g++arm-uclinux-elf-ld.real arm-uclinux-elf-size arm-elf-as arm-elf-gcc arm-elf-ranlib arm-uclinux-elf-as arm-uclinux-elf-gccarm-uclinux-elf-nm arm-uclinux-elf-strings arm-elf-c++arm-elf-gcov arm-elf-readelf arm-uclinux-elf-c++ arm-uclinux-elf-gcc-3.4.3 arm-uclinux-elf-objcopy arm-uclinux-elf-strip arm-elf-c++filtarm-elf-ld arm-elf-size arm-uclinux-elf-c++filt arm-uclinux-elf-gccbug arm-uclinux-elf-objdump genromfs arm-elf-cpparm-elf-ld.real arm-elf-strings arm-uclinux-elf-cpp arm-uclinux-elf-gcov arm-uclinux-elf-ranlib arm-elf-elf2fltarm-elf-nm arm-elf-striparm-uclinux-elf-elf2flt arm-uclinux-elf-gdbarm-uclinux-elf-readelf Am I using the wrong toolchain version? So far I haven't found anything for sure specifying a specific version of the gnu arm-uclinux compiler toolset for uClinux kernel 2.4.x. I may just be missing it. The error I see appears to start with the compilation of assembly units: /usr/local/arm-uclinux-gcc-3.4.3//bin/arm-uclinux-elf-gcc -D__ASSEMBLY__ -D__KERNEL__ -I/home/Virtual_Machines/linux_kernels/uClinux-dist/linux-2.4.x/include -DNO_MM -mapcs-32 -march=armv4 -msoft-float -c -o entry-armv.o entry-armv.S entry-armv.S: Assembler messages: entry-armv.S:1495: Warning: destination register same as write-back base entry-armv.S:1721: Error: undefined symbol TSS_FPESAVE used as an immediate value The above text is the first error. There are many more assembly errors. Any help would be appreciated. -- Greg Ungerer -- Principal EngineerEMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev