Day two of the Hackathon started with a discovery that the pinout of the cyrstal we ordered was mirrored – that was also the reason why we couldn’t measure the clock on the crystal – to resolve this issue we flipping the crystal and soldered it in dead bug style
you can also see that we used some capton-tape in order to avoid shorts on the pads – after making this modifaction the board came up fine with working crystal (no need to enable a register in the ADV7611) as it comes up by default with clock enabled. We were very happy to have this part working 🙂
The next step was to initialize the ADV7611 to a point where we could establish a HDMI Link – for this reason we basically copied the register settings from a adv761x – v4l2 patch for the linux kernel. This worked pretty straight forward but we came accross the following issue: The ADV7611 uses a one fixed I2C Address and and additionally 7 programmable I2C addresses. But when using i2cdetect for some reason the programmable I2C Addresses where not shown up correctly – So Georg had the idea that we should just try to communicate to these addresses via i2cget to see if we get some response, which worked out fine – so this problem was an issue with i2cdetect on the LIME Hardware. The problem showed up with addresses in the 0x60-0x6x Range … Strange, but once we knew that everything is fine we continued.
We used another LIME as HDMI Source and connected the two devices together.
With the basic settings taken from the v4l2 patch we could establish a 480p60 link between the two boards. To see if everything was working we checked the Register 0x6A to see if Bit 4 (TMDS_CLK_A_RAW – TMDS clock detected on port A) and Bit 6 (TMDSPLL_LCK_A_RAW – TMDS PLL on port A is locked to the incoming clock) were set. Next we veryfied the Pixel Clock which was coming out of the ADV7611 which was about 27 Mhz, what was expected.
the code for reading the CLK/PLL Info is:
i2cget -y 1 0x4c 0x6A
When measuring HSYNC and VSYNC we noticed some strange behaviour caused by shorts on the PCB – we continuied working with the second prototyp, which didn’t showed this problem – and Fritz was fixing Prototype 1 in the meantime.
By tweaking the Framerate setting to 50Hz we could establish a 720p50 link with a pixel clock of about 75 Mhz.
We tested further to see if there was real data coming out of the ADV7611 by displaying a simple zebra-pattern.
This way we could count the White-Pixels on the Dataline in respect to the pixel clock and on the osziloskope we could really count the 30 white and 30 black alternating pixels in each line. – So we proven that we are producing a picture on the parallel CSI-Bus, which still may have some issues but could already be clearly distinguished from noise.
So the first steps on the Hardware are looking good – the next step is to import a still image using the CSI-Peripheral of the Allwinner A10 – after a short discussion we decided that it would be necessary to implement this as linux kernel module – so we followed the instructions of Olimex to cross compile the kernel for Olimex Lime and started crafting a kernel module. The process described in the howto was straight forward – Only the indenting of the of the kernel module Makefile – that we copied and pasted made some problems. With an working environment to build kernel modules we wanted to read a register of the CSI1-Peripheral to veryify its after-reset state. – This was a bit tricky because we had to enable the clock of the CSI1-Peripheral first – so at the End of Day 2 we couldn’t make this step.
But the day after I had a look at the i2c-sunxi.c driver to see how to enable the peripherals in a proper way – so after some playing around and releasing the CSI1 from reset state we could read the cfg register.
[ 818.413777] ahb_csi1 Clk enabled! [ 818.419033] csi1 Clk enabled! [ 818.427087] ccm_csi1_clk: 0x80000000! [ 818.433797] ahb1 clock gating: 0x0014fa3c! [ 818.445265] after reset ccm_csi1_clk: 0xc0000000! [ 819.242955] ioremap ok! [ 819.247678] Register = 0x00300205
So we can communicate with the CSI1-Peripheral – The Source can be found on github – Next we need a linux kernel module that initializes the CSI1-Peripheral and tries to capture a single from to a allocated memory location.