• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Linux on A500: The Future

Search This thread

rogro82

Retired Senior Recognized Developer
May 1, 2008
862
445
plus.google.com
Code:
dd if=/dev/zero of=debian-armhf.img bs=750M count=1
sudo mkfs.ext4 debian-armhf.img
mkdir rootfs-mnt
sudo mount -t ext4 debian-armhf.img rootfs-mnt/
sudo qemu-debootstrap --arch armhf wheezy rootfs-mnt/

# in case you are on wheezy you can copy your sources.list... if not generate one here http://debgen.simplylinux.ch/
sudo cp /etc/apt/sources.list rootfs-mnt/etc/apt/sources.list

# copy wifi/bt firmware files to rootfs-mnt/lib/firmware/brcm

sudo chroot rootfs-mnt/
apt-get update

# now install whatever you want ( eg wpasupplicant or anything else you want to use to setup wifi )

passwd root
adduser {yourname}

Thats about it... I dont pre-install anything so that i can get back to a clean base install easily ( besides wifi of course ).

Also if you dd an image over an internal partition do not forget to run resize2fs afterwards ( eg resize2fs /dev/mmcblk0p8 )
 
Last edited:

Skrilax_CZ

Inactive Recognized Developer
Dec 20, 2009
1,240
2,397
Hmm, what are you using for shell input (USB gadget driver not working for me, but I didn't look into it yet)?

Looked on it a bit, noticed some details:

Ethernet gadget / rndis needs patching:
Code:
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index 7b3185f..c9be9d7 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -399,7 +399,7 @@ static int rndis_function_bind_config(struct android_usb_function *f,
 		rndis_control_intf.bInterfaceProtocol =	 0x03;
 	}
 
-	return rndis_bind_config(c, rndis->ethaddr, rndis->vendorID,
+	return rndis_bind_config_vendor(c, rndis->ethaddr, rndis->vendorID,
 				    rndis->manufacturer);
 }
 
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index f187b9e..e0d659e 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -774,8 +774,9 @@ rndis_bind(struct usb_configuration *c, struct usb_function *f)
 	rndis_set_param_medium(rndis->config, NDIS_MEDIUM_802_3, 0);
 	rndis_set_host_mac(rndis->config, rndis->ethaddr);
 
-	if (rndis_set_param_vendor(rndis->config, rndis->vendorID,
-				   rndis->manufacturer))
+	if (rndis->manufacturer && rndis->vendorID &&
+				rndis_set_param_vendor(rndis->config, rndis->vendorID,
+								rndis->manufacturer))
 			goto fail;
 
 	/* NOTE:  all that is done without knowing or caring about
@@ -857,7 +858,7 @@ static inline bool can_support_rndis(struct usb_configuration *c)
  * for calling @gether_cleanup() before module unload.
  */
 int
-rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
+rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
 				u32 vendorID, const char *manufacturer)
 {
 	struct f_rndis	*rndis;
diff --git a/drivers/usb/gadget/u_ether.h b/drivers/usb/gadget/u_ether.h
index 4677241..371c102 100644
--- a/drivers/usb/gadget/u_ether.h
+++ b/drivers/usb/gadget/u_ether.h
@@ -111,13 +111,13 @@ int eem_bind_config(struct usb_configuration *c);
 
 #ifdef USB_ETH_RNDIS
 
-int rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
+int rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
 				u32 vendorID, const char *manufacturer);
 
 #else
 
 static inline int
-rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
+rndis_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
 				u32 vendorID, const char *manufacturer)
 {
 	return 0;
@@ -125,4 +125,22 @@ rndis_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
 
 #endif
 
+/**
+ * rndis_bind_config - add RNDIS network link to a configuration
+ * @c: the configuration to support the network link
+ * @ethaddr: a buffer in which the ethernet address of the host side
+ *      side of the link was recorded
+ * Context: single threaded during gadget setup
+ *
+ * Returns zero on success, else negative errno.
+ *
+ * Caller must have called @gether_setup().  Caller is also responsible
+ * for calling @gether_cleanup() before module unload.
+ */
+static inline int rndis_bind_config(struct usb_configuration *c,
+				u8 ethaddr[ETH_ALEN])
+{
+	return rndis_bind_config_vendor(c, ethaddr, 0, NULL);
+}
+
 #endif /* __U_ETHER_H */

and cmdline is forced by the kernel. Also bootloader inits lp0_vec as
 
Last edited:

Skrilax_CZ

Inactive Recognized Developer
Dec 20, 2009
1,240
2,397
Ah I see, thanks. In which case I'd say that USB host works, USB slave doesn't (no enumeration attempt on host PC).
 
Last edited:

rogro82

Retired Senior Recognized Developer
May 1, 2008
862
445
plus.google.com
K ive atleast applied the patch ( https://github.com/rogro82/picasso-kernel/commit/082b927560aa757d9e48aed6b3ad8bc955aaed20 ) ... ill take a look at usb slave mode

Also anyone knows if upower is broken? all battery related stuff shows 0% capacity ( and upower -d also does ) while sysfs reports the correct battery capacity.

Edit:
Nevermind.. just checked out the latest version of UPower and found the issue... added additional calculations to the battery driver.
 
Last edited:

Skrilax_CZ

Inactive Recognized Developer
Dec 20, 2009
1,240
2,397
Hmm, I'm getting either kernel panic upon inserting wifi module or it bugs here: https://github.com/rogro82/picasso-kernel/blob/master/drivers/mmc/core/sdio_io.c#L28

Maybe I missed something - I did:
Code:
apt-get install broadcom-sta-common broadcom-sta-source firmware-b43-installer firmware-b43legacy-installer b43-fwcutter
and put files to /lib/firmware/brcm
Code:
bcm4329-fullmac-4.bin
bcm4329-fullmac-4.txt
bcm43xx-0.fw
bcm43xx_hdr-0.fw

On a side note I must say that Acer's sound driver is pretty awkward.
 
Last edited:

rogro82

Retired Senior Recognized Developer
May 1, 2008
862
445
plus.google.com
Hmmm wifi issue could be because the current configs builds the staging brcm driver and besides that also the bcm4329 driver as a module... i just reinstalled and also had issues with wifi and they were related to the bcm4329 module so i recommend removing it and taking it out of the config for now.

Also I never do:
Code:
apt-get install broadcom-sta-common broadcom-sta-source firmware-b43-installer firmware-b43legacy-installer b43-fwcutter

I just copy the 4 files ( from which only 2 are used if im not mistaking ).

Currently sound is broken ( well speaker output ) because of this ( in board header ):
#define TEGRA_GPIO_SPKR_EN PICASSO_GPIO_WM8903(0)

should be:
#define TEGRA_GPIO_SPKR_EN PICASSO_GPIO_WM8903(2)

Besides that volume control seems a bit awkward and ill need to play with alsa a bit to see if i can get it right.

https://github.com/rogro82/picasso-kernel/commit/8d88b02e35542776d3df4a3e0575d8eb377141b9
 
Last edited:

Skrilax_CZ

Inactive Recognized Developer
Dec 20, 2009
1,240
2,397
I see about the wifi.

As for sound in the stock 2.6.39.4 kernel, in tegra_wm8903.c there are routing changes ( https://github.com/ezterry/AcerTabKernel/blob/master/sound/soc/tegra/tegra_wm8903.c ), and in the same directory also other code by Acer (yeah, pointless drivers + devices etc.). Anyway there is extra code for volume control and mic recognition, which could be useful. Well I'm trying to clean that. Also it sends two extra commands to EC.
 

rogro82

Retired Senior Recognized Developer
May 1, 2008
862
445
plus.google.com
Ah ok... I havent digged that deep into sound as I didnt know if it was working at all with the 2.6 kernel. I guess the biggest issue is that the sound is over amplified as sound control works in the lower region.

As for wifi Ill check if i can get the bcm driver working instead of the current staging driver. Any other big issues you have seen so far?
 

randomblame

Recognized Developer
May 18, 2009
2,710
18,009
nice work I'm cloning the repo now

got it to build with the android requirements lol fun.

It boots to text that says android_ no usb crap well at least it loaded init. Must be some paths off

*got adb yay

I'm just having fun no real point I know
 
Last edited:

rogro82

Retired Senior Recognized Developer
May 1, 2008
862
445
plus.google.com
Hi,
Any tips on compiling this thing? what toolchain I need etc. :)

You can use arm-none-eabi ( Sourcery Lite ) and im currently using linaro arm-linux-gnueabihf...

nice work I'm cloning the repo now

got it to build with the android requirements lol fun.

It boots to text that says android_ no usb crap well at least it loaded init. Must be some paths off

*got adb yay

I'm just having fun no real point I know

Nice!
 

rogro82

Retired Senior Recognized Developer
May 1, 2008
862
445
plus.google.com
For anyone using the latest version of ubuntu and is having issues with trying to get emulation for right mouse click to work this might be because the latest evdev driver has multi-touch which has broken some other things.

I have had success reverting to an older build and can now once again use long press to emulate right click.

Code:
git clone git://anongit.freedesktop.org/git/xorg/driver/xf86-input-evdev
cd xf86-input-evdev
git checkout -b evdev-2.7-branch origin/evdev-2.7-branch
./autogen.sh --prefix=/usr
make && sudo make install
 

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    We have had native Linux on our Iconias for quite a while now but the builds and kernels are getting outdated, Unity is here and there is no real direction as to what needs to be accomplished.

    This thread has been started principally for two kinds of people:
    1. Kernel and Linux developers whom can offer advice or indeed actual code
    2. Iconia enthusiasts for suggestions / ideas as well as any logic they may have
    This thread does not aim to make Linux on our Iconias poof out of nowhere. It requires a huge amount of work to get going although with proper information exchange it should be much easier to get the project going.

    The current ToDo list is as follows (feel free to post me more):
    • RootFS on /data/linux
    • Kernel initrd which will chroot to /data/linux
    • Linux Kernel will boot off mmcblk0p7
    • Upgrade to Ubuntu 12.04 (although RootStock is now deprecated, we can just download a pre-built bundle for the arm-eabi FS, use live-build or get a pre-made RootFS. There's lots of options for this)
    • Build the kernel from scratch (this is kind of obvious anyway). Building for armhf sounds like a good idea
    • Full graphics acceleration from the Tegra 2 for Unity
    • Perhaps a build of Backtrack (this shouldn't be too difficult - they offer an image for arm. If it can share the kernel then we should be okay)
    • A501 3G Modem
    • USB Huawei Modems (although initial Googling seems to imply the compatibility of usbserial.ko and hence OOTB compatibility so long as a udev rule is added)
    • Camera, sensors and non-patchy wifi (issue on 2.6.38 although the nvidia drivers below should fix this)
    • Latest Linux kernel (ie 3.1.x)

    We have plenty of resources at our disposal such as:

    I've looked inside the Linux for Tegra package and a HUGE amount is in there including x configurations, hardware drivers, Broadcom wifi firmware and the list goes on.......
    There's also a codec package so we can have native video acceleration in loads of formats.

    The bootloader will, at least initially, probably be the default Acer one. We could utilise kexecboot in the future as noted above

    What we need:
    • A system for organising the code. CI & trac?
    • Perhaps a wiki.... or at least somewhere to organise ideas and reversed data
    • Either role assignment or a huge number of 'issues' with the code on a system such as trac and anybody can fix any issue

    What works without kernel hacking:
    • Sound: The Wolfson WM8903 sound chip has driver provided by Wolfson which have been integrated directly into the official Linux kernel source (source: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices)
    • Wi-Fi (almost) - the broadcom drivers are available with a simple apt-get. They are also available through Linux for Tegra
    • Graphics Acceleration (Hardware) - the drivers and codecs come from Linux for Tegra
    • armhf - Support for the hard float capabilities is built right into the Tegra2 and both Ubuntu and Linux for Tegra provide this support alongside the (seemingly legacy!) armel
    • The RootFS can now be built with qemu-debootstrap
    Please let me know if I forgot anything else (which I undoubtedly did!)
    4
    First, we have 3.0.0 kernel by sp3dev (having issues), I'll take look on that one. Eventhough kernels 3.0.y and 3.2.y (not 3.1.10 - that's EOL!) are good enough.

    Secondly, kernel does not chroot, a script in initrd image does chroot (this isn't any magic). As in the previous question about cmdline, it's just say "dynamic configuration" for the kernel (as where to find rootfs etc.). In the linux kernel, it's hardcoded right now (needs to be undefined).

    First, it's better to get points 1) - 3) working for now.

    There is a strong focus on the preliminary uboot bootloader, however. I'm not sure if this would replace the Acer bootloader or be chainloaded? Ideally we just want a boot img on mmcblk0p7. Can somebody confirm this for me? :)

    No that's not possible. U-boot will be standalone bootloader (i.e if u-boot, then no Acer BL). Right now, my patch in Acer BL gives us a "sub-bootloader" (don't want to call it second-stage bootloader, because it always returns back to Acer BL, eventhough we submit the image as a byte array (and not a partition)).
    4
    I think its a good idea to start from 3.1.10 that's on nv git and has linux variant too...
    3
    I think its a good idea to start from 3.1.10 that's on nv git and has linux variant too...

    I think its a good idea someone cares to share his android kernel source. I tried to rebase my cros patches on top of nvidia android branch and most stuff seems to boot, but fb is not working.

    I think I'll make a new version of uboot that will be able to boot custom kernel from a file/script in data partition and stock kernel from recovery partition. I have made a good port of uboot to sgs2 and now I know how to handle boot mode detection via gpio. Sadly I'm not using my iconia at all lately.


    P.S. Everything works on 2.6.38 except camera and sensors. Wifi is unstable. What else could anyone probably want
    2
    Add to todo. 3G modem for A501