Have you tried to remove the 'console' argument completely and only include 'earlyprintk' without any further arguments to it (i.e. without =whatever)?
Hi All!
I have just got my tablet. It has Via VM8850 processor. It works with 3.0.8+ kernel. (I don't know what means the '+' sign). By the way, I would like to compile modules and add to the kernel. For example Ftdi.I have been searching a log for kernel source, .. etc. I 've tried to compile ( it built), but it did not work. (exec format error)Have anybody an idea, or source, or something. It will be really helpfull.Best regards.xvlabby (hu)
Hi Peter!
It's great that you are investigating these, more eyes are always better, and definitely welcome!
Regarding your USB problems, I'm very suspicious that it might be related to IRQ. Have you had chance to cross-check your dts file vs. /proc/interrupts under the stock kernel?
Best,
Alexey
Time for another update :-) Didn't have as much time over the weekend as I'd like to, but I still checked out a few things. Archlinux on stock android 3.0.8 kernel has a pretty critical flaw - the wifi adapter apparently turns off the radio whenever external power adapter is disconnected. I haven't found any way to control it so far, I don't even know if it's done by hardware or by the stock driver module. If it's done by hardware there could be the same problem for driver module in 3.7, that would somehow have to keep the radio on while on battery power. Well, with this problem the netbook is quite useless with stock kernel, as mobility is pretty much it's only positive :-(3.7-rc3 kernel still has a problem with USB2 speed I've already mentioned. It's a real pain, just to boot the system takes som 10-12 minutes.Built-in wifi doesn't work at all, even if I turn on the controlling GPIO, I can't see any changes on USB bus. I don't know if the problem is in wifi initialization (something else needs to be done beside the GPIO?) or in the USB system (which is far from perfect anyway).I've connected external USB WIFI dongle (some ralink rt2800), this gets detected on the USB2 bus, driver module loads fine (although terribly slowly) and I can see wlan0. "iw" tool can see it and also control it partially (I could see my 11g wlan on scan, but not the 11n one, though the adapter is 150Mbps 11n). Funny thing is iwconfig/iwlist don't report it as wifi at all... I could not establish a wifi connection, it always failed somewhere in wpa_supplicant. I can supply the debug log from supplicant if anyone's interested, I haven't been able to pinpoint the exact problem myself. Perhaps the faulty USB2 bus screws up somehow?As for framebuffer, apparently it doesn't work as easily as with stock kernel. I have a test program that just checks /dev/fb0 with some ioctls (simple screensize/bpp detection) and then mmaps framebuffer memory and tries to write some pixels. On stock 3.0.8 kernel this works just fine, draws a rectangle over anything on screen. In 3.7-rc3 I can't see anything at all. Maybe some additional initialization is required, haven't yet got time to look into it.Regards,Peter
Now to interrupts in dts - first there is a whole list of them in intc1: interrupts = <56 57 58 59 60 61 62 63> but none of those is mentioned in /proc/interrupts, so I've left them be for now.
[ 0.110000] [<80013bc8>] (unwind_backtrace+0x0/0x138) from [<801889b4>] (Ldiv0+0x8/0x10)
[ 0.110000] [<801889b4>] (Ldiv0+0x8/0x10) from [<8029f0bc>] (vtwm_pll_recalc_rate+0x68/0x6c)
[ 0.120000] [<8029f0bc>] (vtwm_pll_recalc_rate+0x68/0x6c) from [<8029de5c>] (__clk_init+0x184/0x404)
[ 0.120000] [<8029de5c>] (__clk_init+0x184/0x404) from [<8029e1a4>] (_clk_register+0xc8/0x15c)
[ 0.130000] [<8029e1a4>] (_clk_register+0xc8/0x15c) from [<8029e2e0>] (clk_register+0x3c/0x88)
[ 0.130000] [<8029e2e0>] (clk_register+0x3c/0x88) from [<804bd024>] (vtwm_pll_clk_init+0x104/0x154)
[ 0.140000] [<804bd024>] (vtwm_pll_clk_init+0x104/0x154) from [<804bcc40>] (of_clk_init+0x2c/0x50)
[ 0.140000] [<804bcc40>] (of_clk_init+0x2c/0x50) from [<804acd88>] (wm8950_init+0x130/0x1b0)
[ 0.150000] [<804acd88>] (wm8950_init+0x130/0x1b0) from [<804a9400>] (customize_machine+0x1c/0x28)
[ 0.150000] [<804a9400>] (customize_machine+0x1c/0x28) from [<80008754>] (do_one_initcall+0x10c/0x170)
[ 0.160000] [<80008754>] (do_one_initcall+0x10c/0x170) from [<80358868>] (kernel_init+0x140/0x2ec)
[ 0.160000] [<80358868>] (kernel_init+0x140/0x2ec) from [<8000ead8>] (ret_from_fork+0x14/0x3c)
[ 0.170000] Division by zero in kernel.
[ 0.170000] [<80013bc8>] (unwind_backtrace+0x0/0x138) from [<801889b4>] (Ldiv0+0x8/0x10)
[ 0.180000] [<801889b4>] (Ldiv0+0x8/0x10) from [<8029f0bc>] (vtwm_pll_recalc_rate+0x68/0x6c)
[ 0.180000] [<8029f0bc>] (vtwm_pll_recalc_rate+0x68/0x6c) from [<8029de5c>] (__clk_init+0x184/0x404)
[ 0.190000] [<8029de5c>] (__clk_init+0x184/0x404) from [<8029e1a4>] (_clk_register+0xc8/0x15c)
[ 0.190000] [<8029e1a4>] (_clk_register+0xc8/0x15c) from [<8029e2e0>] (clk_register+0x3c/0x88)
[ 0.200000] [<8029e2e0>] (clk_register+0x3c/0x88) from [<804bd024>] (vtwm_pll_clk_init+0x104/0x154)
[ 0.200000] [<804bd024>] (vtwm_pll_clk_init+0x104/0x154) from [<804bcc40>] (of_clk_init+0x2c/0x50)
[ 0.210000] [<804bcc40>] (of_clk_init+0x2c/0x50) from [<804acd88>] (wm8950_init+0x130/0x1b0)
[ 0.210000] [<804acd88>] (wm8950_init+0x130/0x1b0) from [<804a9400>] (customize_machine+0x1c/0x28)
[ 0.220000] [<804a9400>] (customize_machine+0x1c/0x28) from [<80008754>] (do_one_initcall+0x10c/0x170)
[ 0.220000] [<80008754>] (do_one_initcall+0x10c/0x170) from [<80358868>] (kernel_init+0x140/0x2ec)
[ 0.230000] [<80358868>] (kernel_init+0x140/0x2ec) from [<8000ead8>] (ret_from_fork+0x14/0x3c)
[ 0.240000] bio: create slab <bio-0> at 0
[ 0.240000] SCSI subsystem initialized
[ 0.250000] libata version 3.00 loaded.
[ 0.250000] usbcore: registered new interface driver usbfs
[ 0.250000] usbcore: registered new interface driver hub
[ 0.260000] usbcore: registered new device driver usb
[ 0.260000] Switching to clocksource wm8950_timerNew timer driver or a rename?
I thought that Peter was playing around with timers, so in case he
makes any progress and shares that as a patch, it might make sense to
push it upstream as well... This doesn't feel like a high-priority
task to me, frankly.
Best,
Alexey
Hi, I have simply copied arch/arm/mach-vt8500 to arch/arm/mach-wm8950, created ARCH_WM8950 (changed all the sources so that everything depending on VT8500 gets activated for WM8950 as well) and created new wm8850.dtsi and wm8850-netbook.dts :-) From there I only played in mach-wm8950 directory, didn't touch anything in original VT8500. The wm8950_init comes from my new mach code, basically just copy/paste with fixed names.I THINK I might have found out why the clock is throwing exceptions. The vtwm_pll_recalc_rate in drivers/clk/clk-vt8500.c has 2 different calculation methods for VT8500 and WM8650 clock types. Actually there are more functions in this driver dependent on whether vt8500-pll-clock or wm8650-pll-clock is specified in dts. Currently I have wm8650 clock in my dts, and I'm afraid the calculation method to get PLL multipliers and divisors for WM8850 from the register value is different than it was for 8650. I put out some logs in recalc_rate:[ 0.100000] vtwm_pll_recalc_rate(WM8650): rate=017d7840, val=00410101, mul=00000101, div=00000000[ 0.110000] vtwm_pll_recalc_rate(WM8650): rate=017d7840, val=002b0101, mul=00000101, div=00000000I think first line is for plla and the second one for pllb. Base rate is 25MHz which is fine according to dts, but apparently register value is structured differently than 8650. I'm not sure which part is divisor and which is multiplier, or even if it's really as simple as in 8650 :-( I've checked the wmt-clk.c in apc-8750 sources, and it looks a bit more complicated than that. There's something like this:tmp = *(volatile unsigned int *)(PMC_PLL + 4*PLL_NO);PLL = SRC_FREQ*(((tmp>>16)&0xFF)+1)*base;//printk(KERN_INFO" PLL =%llu\n", PLL);div_llu = (((tmp>>8)&0x3F)+1)*(1<<(tmp&7));PMC_PLL is PMC_BASE+0x200, PLL_NO is just index (A=0, B=1,...), so tmp gets register value (val in my log above). It looks like for the first line of log multiplier should be 0x41+1=66 and divisor (0x01+1)*(1<<0x01)=4, that would create some 412.5MHz clock (SRC_FREQ is 25 and base 1000000, for 25MHz I suppose). Second multiplier would be 44 with same divisor, thus 275MHz clock. No idea if those values are correct, though...I'm gonna add new clock type wm8850 with this calculation, let's see what it does.
OK, I have mmc working now. Not very clean method though... I couldn't get consistent results with any combination of delays or disabled caches I could think of, until it occured to me to (ab)use uboot. So now I call "mmcinit 0" before each kernel boot, and everything works like a charm, no delays, no debug logs (except clock, though I'll probably disable that, too, now) or cache disabling necessary. Surprise, surprise :-/ Apparently it eventually get's mmc interface on 55MHz, which is even more than uboot sets (41MHz I believe) :-) It's quite fast, reads my SD card over 20MB/s. Even card remove/insert detection works fine.
The clock subsystem should do its reference counting internally.
I'm actually inclined to claim that the brightness driver is the faulty one, as it creates asymmetry in enable/disable routines.
Something else occured to me - how does kernel clock subsystem manages more devices referencing the same clock? If you wanted to use another PWM pin, you'd have to add another section in dts, I suppose, referencing the same clock. Now both PWM devices would call devm_clk_get in their _probe... what would the clock do if one of them called disable, while the other was still running? Could it be the clock system internally handles multiple instances, and only stops the clock if all using devices disabled it? In that case we would only have to avoid writing pwm registers if the clock wasn't enabled, right?BR,Peter
I've done something similar. I include clk-private.h instead of clk.h, and I call clk->ops->is_enabled(clk->hw), only if it's present of course, which on clk-vt8500 always is. Its implementation in clk-vt8500 actually checks the pwm clock bit in PMC, so it should be pretty reliable.I've added period and duty cycle for each pwm pin into vt8500_chip structure, I'm saving it there on each vt8500_pwm_config. From there it's pretty simple - I only access the registers if clock is enabled, and I call one additional vt8500_pwm_config in vt8500_pwm_enable after enabling the clock but before actually enabling the pwm pin, with period/duty saved from last config call. So the pwm pin should always be enabled with last configured values.I'm not sure if it's recommended practice, but it's probably the simplest and less "hacked" way to avoid accessing inactive pwm registers while still only starting PWM with valid values. Until anyone thinks of a better way, I consider this issue closed ;-)BR,Peter
Hm, that makes sense if we have to avoid internal clock structures. I've just tried it, looks fine. No crashes, values set in backlight/brightness while bl_power=1 are then activated once bl_power is set back to 0. I can also see the pwm bit enabled for a couple ms while changing brightness value. I can't confirm for certain it's the PWM module keeping the values while disabled though, because backlight driver always calls config after enable.BR,Peter
Note that you can also dump registers using u-boot commands via serial console (from what I remember, 'md' displays and 'md' writes memory contents).
Best,
Alexey