Tuesday, November 30, 2010

GA330 serial console

I just added a serial console port to one of my GA330. The pictures below detail the TX and RX pins location and the final result.


Green wire is TX, orange is RX, white is GND (you can probably connect to GND more easily anywhere on the other side of the PCB).



For the curious, here's the boot output (57600 8N1):

ChinaChip IPL V1.04
Data : Jun 08 2010 Time : 17:31:33

SDRAM CAPACITY IS: 04000000
89D7943E
000084FF
Total Size = 0x00047D60

!!! Ecc Correct Error !!!
!!! Ecc Correct Error !!!
.!!! Ecc Correct Error !!!
.Loader Size = 0x00037D60

ChinaChip SPL V1.14
Data : Aug 06 2010 Time : 16:02:01

loader is normal mode...
loader_burning = 0
Battery Voltage = 3746.
g_poweron_vol = 3550
ccpmp_config Ver : 1.08 !!!
LCD Set Init !!!!
LCD Set Init Over !!!!
ccpmp_config.firmware_name = A330.HXF ...
ccpmp_config.update_key = 0x81 ...
ccpmp_config.lcm_name = LCM_TB_TD030WHEA1_320_240 ...
LCD Init Begin.

CN2009P_CFG.DL Data : Aug 25 2010 Time : 17:38:37

****** Enter LCD Init ******
wHCLKDIV = 1, wLCLKDIV = 0
num = 0, flag = 0
num = 1, flag = 0
num = 2, flag = 0
num = 3, flag = 0
wHCLKDIV = 1, wLCLKDIV = 0
num = 1, flag = 1
update key bDevMode = 0
ccpmp_config.load_mode = 0
ret = 0x00102878
usb_mode = 1
NAND ID:
89D7943E
00008400
A0FFFFFF
0000FFFF
A0FFFFFF
0000FFFF
80FFFFFF
0000FFFF
A0FFFFFF
0000FFFF
Nand manufacturer 0: inter
Nand type 0: 4GB
Nand manufacturer 1: Unknown
Nand type 1: Unknown
Nand manufacturer 2: Unknown
Nand type 2: Unknown
Nand manufacturer 3: Unknown
Nand type 3: Unknown
Nand manufacturer 4: Unknown
Nand type 4: Unknown
Nand manufacturer 5: Unknown
Nand type 5: Unknown
Nand manufacturer 6: Unknown
Nand type 6: Unknown
Nand manufacturer 7: Unknown
Nand type 7: Unknown
(dev 0)offset = 8192.
(dev 0)size = 131072.
(dev 0)nb_block = 256.
xxx -- nf_bi[0] 8192.
000 -- sta_block = 16, sta_chip = 0, end_chip = 8192.
xxx -- aaa.
001 -- end_block = 272, sta_chip = 0, end_chip = 8192.
xxx -- bbb.
xxx -- 002.
(dev 0)start chip = 0.
(dev 0)start block = 16.
(dev 0)end chip = 0.
(dev 0)end block = 271.
_this->start_chip = 0, _this->end_chip = 0.
nand_scan_blocks -- 000.
nand_scan_blocks -- 001.
block range of partition 16 ~ 272 on chip 0.
Found bbt at block 16, ver:0x0001.
bklight level: 00000004
bk value = 98
update_succ = 0
ccpmp_config.load_mode = 0
hxf_exist = 0
Play Logo on Music !!!
animation total frame = 15.
CC1800 Run OS ....
nandc0 - chip0, ID: 89 d7 94 3e 84 0
nandc1 - chip0, ID: 80 fe ff ff ff ff
nandc1 - chip1, ID: 80 ff ff ff ff ff
nandc1 - chip2, ID: 80 fe ff ff ff ff
nandc1 - chip3, ID: a0 ff ff ff ff ff
gDiskCapacity = 7941120
begin fs_init...
begin cc_ntfs_init ...
cc_ntfs_init ok ...
fs init OK.
s_wLongPressGOHOME -1
SWITCHOFF KEY register -1
RMT 17 )
LCD Set Init !!!!
LCD Set Init Over !!!!
Init UDC
in otg init 3-14
out otg init
OS Heap Information:
Total Size: 0x00e00000
Used Size: 0x00245e24
Free Size: 0x00bba1dc
AP Heap Information:
Total Size: 0x02000000
Used Size: 0x0018ec8c
Free Size: 0x01e71374
OS Heap Information:
Total Size: 0x00e00000
Used Size: 0x00245e90
Free Size: 0x00bba170
AP Heap Information:
Total Size: 0x02000000
Used Size: 0x0018ec8c
Free Size: 0x01e71374
OS Heap Information:
Total Size: 0x00e00000
Used Size: 0x00245e90
Free Size: 0x00bba170
AP Heap Information:
Total Size: 0x02000000
Used Size: 0x001ff61c
Free Size: 0x01e009e4

Back from China

I'm back in one piece. It's been an exhausting trip and an amazing experience. I'm still in conversations with ChinaChip and will be writing some more updates in the following days. Meanwhile, a quick trip log:

20/11 Sat - Flight from Valencia to Paris, where I have a 6h transfer.

21/11 Sun - Flight from Paris to Hong Kong. The 12h trip is not as bad as expected because I score nothing short of 9h sleeping. They pick me up at the airport and take me to Shenzhen, have dinner, and then go to Dongguan straight to the hotel. I realize I'm gonna have a very hard time getting used to the chinese pronunciation of english.

22/11 Mon - Pick up at the hotel, not too early because I'm seriously jetlagged and wasn't able to sleep much. We go to the ChinaChip main headquarters and factory where I'm introduced to all the department heads and a few engineers. I visit all the facilities including the factory, and later have a meeting to outline the matters we should discuss in the following days. Excellent dinner with ChinaChip's president.

23/11 Tue - I've been able to sleep just a couple of hours from 10:00 to 12:00, and it's now 7:00 and I'm broken. Had arranged pick up at 9:00 but must delay it a few hours in order to try to catch some sleep. End up having lunch before going to ChinaChip's headquarters, where I spend most of the rest of the days in meetings.

24/11 Wed - Was able to sleep a bit more, so we can go early to the headquarters. More meetings in the morning, and then a walk around Dongguan downtown main square, which is amazingly huge. Late in the evening we travel to Shenzhen where we pay a quick visit to the marketing an sales offices and then go to the hotel to leave the baggage. Nice seafood dinner by the hotel and out to a club for a few beers and some fun.

25/11 Thu - Visit to the China Folk Culture Village park in Shenzhen, where you can see scaled down reproductions of the most important chinese landmarks, together with some other cultural information on the many ethnic groups. The park is huge and we spend the whole morning there. Then lunch and visit to Shenzhen's shanzhai market, which is shocking and will require a whole post. I could have very well spent several days in the market, but had to travel to Hong Kong, where we arrive by 21:00 after a tedious trip and several customs inspections. There's not much day left, so I just have a short walk on the Kwoloon shore to admire the island's view.

26/11 Fri - Full day on my own in Hong Kong. So much to see, so many people everywere. This also requires a whole post.

27/11 Sat - Plane takes off at 10:45, 13h flight (I score only 7h sleep in this one), 2.5h transfer in Paris, 1.5h flight and back in Valencia.

I'll also try to quickly summarize, for now, the content of the meetings with the ChinaChip folks:

- They will make changes to their bootloader and internal flash layout so that the dingux kernel and rootfs is installed in the internal flash. Both for the A320 and GA330 consoles. You'll have access to the internal flash from dingux (but the NTFL won't be released). The installation of dingux will be streamlined in the same way native firmware updates are, so no need to fiddle with usb tools any more.

- There will be dingux for the GA330, with full hardware support, and full open source. There's no problem with knockoffs here because it is based in their propietary CC1800 chip not available to third parties (as opposed to the JZ4732 in the A320).

- There is no schedule for the above as of now, since they're yet to decide if and how they'll sponsor it. In other words, one extreme is I work on it on a hobby basis as I've been so far and at zero cost, and the other extreme is they hire me full time. Anything in between is possible.

- The next generation of consoles will be based on the CC2000 and expected to roll out by Q2 next year. The CC2000 will be announced in a month or so, and I've been kindly asked not to reveal the details, but as you can imagine, it's beast compared to the JZ4732 and CC1800.

I'm sure I'm leaving something out, but I'll continue posting as things come up while I review my notes and prepare the reports of the meetings I'll be sending to ChinaChip. I'll also review the huge lot of pictures I took and post some.

Someone at #dingoonity said he needed a replacement speaker for his A320. Got it, but don't remember who he was. Email me, please.

Friday, November 19, 2010

Traveling to China

I'm leaving tomorrow to HK/China, where I'll be meeting the ChinaChip people. Will be back in a week, but will try to update as time permits on anything relevant to dingux on the GA330.

UPDATE: Paris CDG airport is da bomb. At least in terminal E where I am as I write this, plenty of places to lay and take a nap, massage chairs, PS3 for entertainment (free). The 5 hours I have to wander here suddenly don't feel so uphill.

They even have 10 minute free wifi. Too bad it's only 10 minutes. Unless you disconnect, clear the browser cookies, change the WiFi interface MAC address, and connect again, of course. You didn't read that here.

sudo ifconfig wlan0 hw ether [your previous MAC + 1]

Monday, November 8, 2010

DA330 ---> GA330

I'm not sure I understand as of know the relationship between ChinaChip, Dingoo, and Dingoo Technology. It appears that there are two Dingoo companies, one that produces 3D games and another that actually produces the A320. Both belong to ChinaChip group. Then there's Dingoo Technology, which have marketed the A330 which is basically an A320 (JZ4732/JZ4740 SoC) with a different case/LCD, 64MB RAM and stolen firmware. In order to avoid confusion with the later, at some point I decided to refer to it as A330 and to refer to the newer, CC1800 based machine as DA330. But I was mistaken since it is Gemei (another company of the ChinaChip group) who will be marketing it (my two sample machines have both the Gemei logo). So, I figured out I'd rather fix this silly mistake soon. So, from now on, I'll refer to the newer CC1800 based A330 as GA330.

Sorry for any caused confusion. I've edited previous blog entries to reflect this change.

Sunday, November 7, 2010

hwinit fixed

I just modified hwinit (in the subversion repository) so it works on all A320 out there. These are the changes:
  • Added WP bit clean in CP0 CAUSE register (original idea by BouKiCHi).
  • Added LCD init and logo display as visual feedback of hwinit success (original idea also by BouKiCHi).
  • Code cleanup and removal of unneeded nand code.
Kudos to BouKiCHi for an awesome work of debugging.

The first fix is just weird. CP0 means "coprocessor 0" in MIPS architechture. It's the part that takes care of memory management, exceptions, privilege levels and such. It turns out that some versions of the IPL (Initial Program Loader) ROM code in the JZ4732 set up the WATCH registers in such a way that a watch exception occurs but it deferred (by setting the bit WP in the abovementiones CAUSE register). Then later, when the linux kernel boots, as soon as it sets up the CP0 STATUS register (another special regitser of the same "coprocessor"), the WATCH exception is immediately serviced, caused an unhandled exception panic (that is: for people suffering this problem, hwinit was actually working, but the kernel was panicking way before the LCD was initialized, so they could see nothing at all).

Why some IPL ROM versions behave this way is a mystery, and would be harmless if the kernel MIPS initialization code was careful enough as to clear the WP bit before setting up the CP0 STATUS register (I bet this is fixed in more recent kernels, but I'm too lazy to verify it).

I'm working to provide a native firmware based dual boot installer, so this hwinit issue wasn't really top priority, but it had bugged me for so long that I just had to sort it out before continuing. I'm just like that, like to walk on solid ground and feel very uncomfortable when I leave loose ties behind me.

I won't make a new dual boot installer release with just the fixed hwinit, since by now I guess all those with trouble have eventually been lead to hwinit2. Next release should, in my opinion, include at least:
  • A newer kernel with:
  1. Fixed I/O corruption bug(either Ingenic or OpenDingux based).
  2. with support for newer flash chips in recent A320.
  3. Support for x760+.
  • An updated buildroot and toolchain, with both 32 and 64 bit versions. I had to upgrade my buildroot since the old one didn't compile in my Ubuntu 10.04 x64 box.

Thursday, November 4, 2010

x760+ key mappings

I know I asked this before, but it was loooong ago, and I'd like some more input on the topic. The x760+ has only UP/DOWN/LEFT/RIGHT/A/B/X/Y keys, which means START, SELECT, LSHOUDLER, RSHOULDER and HOLD are missing and they'll have to be emulated or I guess some dingux apps out there will not be usable.

The funny thing is that the schematic shows actual HOLD, START and SELECT keys. Incidentally, it also has LSHOULDER and RSHOULDER, but those are available only as test pads (which means someone with enough time could theoretically add them).

So I've though this simple approach:
  • POWER + UP = LSHOULDER
  • POWER + DOWN = SELECT
  • POWER + Y (triangle) = RSHOULDER
  • POWER + B = START
None of those combinations will be comfortable to use, but it's better than nothing. I just chose the combinations so they reflect the spatial locations of the corresponding keys in the A320. Will have to increase the reboot/poweroff time when POWER is pressed, otherwise it might be accidentally triggered when using the combos.

Comments welcome.

Tuesday, November 2, 2010

Electronica 2010

Next week I'm going to electrodisneyla... er... I mean electronica 2010, in Munich. Since there are only direct flights from Valencia on tuesday and saturday, I'll be staying there for more days than I really need to visit the trade fair, so I'll have some spare time. Please let me take the liberty to use this otherwise technical blog to kindly ask for advice on what to do in Munich (besides beers and flash job interviews :-)

Thanks.

Monday, November 1, 2010

GA330 specs

I believe there's some confusion on the GA330 specs. As I mentioned in the previous post, I have only preliminary, general, info, but this is what I found out so far (don't take it for granted anyway):
  • CC1800 processor (ARM926 400MHz).
  • 320x240 LCD, slightly larger than the A320 one.
  • 64MB RAM.
  • 2.4 GHz communication module. This is a true radio device and not just a keyboard hack. Enables multiplayer and custom peripherals.
  • USB OTG port, which allows connecting USB devices, but you'll need external +5V power (i.e. a powered hub).
The CC1800 has some nice features: the OMIP seems to be a video decoding coprocessor, and the VPU seems to be some kind of video post processor which can do quick scaling and color conversion before spitting out the data to the LCD.

I would say that the CC1800 CPU core belongs in the same class than the JZ4732 in the A320, however, being an ARM architecture has the advantage of the existing assembly optimized emulation cores. I bet that the VPU will allow a sizeable boost in performance by offloading the color conversion work from the SDL code.

64MB vs. 32MB in the A320 are a big advantage too.