mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] Crosscompile a WIFI USB stick firmware with ptxdist
@ 2012-12-27 13:12 Dr. Patrick Langfeld
  2012-12-27 14:01 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Dr. Patrick Langfeld @ 2012-12-27 13:12 UTC (permalink / raw)
  To: ptxdist


[-- Attachment #1.1: Type: text/plain, Size: 1002 bytes --]

Hello everyone,
I want to use an WIFI USB adapter D-Link DWA-160 with my ARM iMX53.

My kernel is already configured with the wireless LAN components for 
80211 and the driver in Lan USB network adapter using the CARL9170, 
which is the correct one for the DWA-160.

Now the hard part is to crosscompile the firmware carl9170-1.fw for the 
USB network adapter. The sources can be found in a git repository
https://github.com/chunkeey/carl9170fw.git

and come with an autogen.sh script file, which I attached for you to 
have a look at.

Now I am wondering HOW TO PROCEED and implement the build process of 
autogen.sh in ptxdist and which package type is appropriate. Is it a 
./ptx newpackage target or a src-cmake-prog as the autogen.sh makes use 
of cmake.
In the readme file is written, that to build the firmware one would need 
a SH-2 toolchain. Is this also true for cross-compilation? Do I really 
need to build this toolchain first?

Best regards
  Patrick







[-- Attachment #1.2: Type: text/html, Size: 12610 bytes --]

[-- Attachment #2: autogen.sh --]
[-- Type: application/octet-stream, Size: 675 bytes --]

#!/bin/bash

set -e

case "$1" in
	config)
		echo "Configuring..."
		pushd config
		cmake .
		make
		popd
		config/conf Kconfig
		cmake .
	;;

	compile)
		echo "Compile time..."
		make
	;;

	install)
		if [ ! -e .config ]; then
			exit 1
		fi

		. ./.config
		make

		echo -n "Installing firmware..."
		if [ "$CONFIG_CARL9170FW_BUILD_TOOLS" = "y" ] &&
		   [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
			echo -n "Apply miniboot..."
			tools/src/miniboot a carlfw/carl9170.fw minifw/miniboot.fw
		fi

		sudo install -m 644 carlfw/carl9170.fw \
			/lib/firmware/carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
		echo "done."
	;;

	*)
		$0 config
		$0 compile
	;;


esac

[-- Attachment #3: CMakeLists.txt --]
[-- Type: text/plain, Size: 418 bytes --]

cmake_minimum_required(VERSION 2.8.4)

project(carl9170)

#if you don't want the full compiler output, remove the following line
#set(CMAKE_VERBOSE_MAKEFILE ON)

include("config.cmake")

add_subdirectory(carlfw)

if (CONFIG_CARL9170FW_BUILD_MINIBOOT)
	add_subdirectory(minifw)
endif (CONFIG_CARL9170FW_BUILD_MINIBOOT)

if (CONFIG_CARL9170FW_BUILD_TOOLS)
	add_subdirectory(tools)
endif (CONFIG_CARL9170FW_BUILD_TOOLS)


[-- Attachment #4: README --]
[-- Type: application/octet-stream, Size: 846 bytes --]

Community AR9170 Linux firmware
-----------------------

This is the firmware for the Atheros ar9170 802.11n devices.

To build the firmware you will need an SH-2 toolchain.
You can build your own toolchain:

make -C toolchain

but be aware that this will take some time and requires
about 2.4 GiB disk space.

The resulting firmware, carl9170.fw, can be used only
with the carl9170 Linux driver.

After getting a toolchain, you will need to get more
tools & libs:

 * gcc 4.7+

 * gperf, bison/flex

 * cmake 2.8.4+

afterwards, simply execute:

autogen.sh

to start the configuration and build process.

if you want to "install" your own firmware, you can either
do this manually, or by executing:
 
autogen.sh install

This will place a copy with the right filename [adds API rev]
into /lib/firmware/[the default path on most Distributions].


[-- Attachment #5: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] Crosscompile a WIFI USB stick firmware with ptxdist
  2012-12-27 13:12 [ptxdist] Crosscompile a WIFI USB stick firmware with ptxdist Dr. Patrick Langfeld
@ 2012-12-27 14:01 ` Thomas Petazzoni
  2012-12-28 10:00   ` Josef Holzmayr
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2012-12-27 14:01 UTC (permalink / raw)
  To: ptxdist, Dr. Patrick Langfeld

Dear Dr. Patrick Langfeld,

On Thu, 27 Dec 2012 13:12:28 +0000, Dr. Patrick Langfeld wrote:

> My kernel is already configured with the wireless LAN components for 
> 80211 and the driver in Lan USB network adapter using the CARL9170, 
> which is the correct one for the DWA-160.
> 
> Now the hard part is to crosscompile the firmware carl9170-1.fw for the 
> USB network adapter. The sources can be found in a git repository
> https://github.com/chunkeey/carl9170fw.git

If you don't intend to do active development on this firmware, it's
probably easier to use a pre-built version of it, as available at
http://linuxwireless.org/en/users/Drivers/carl9170#Firmware_binary.

> and come with an autogen.sh script file, which I attached for you to 
> have a look at.
> 
> Now I am wondering HOW TO PROCEED and implement the build process of 
> autogen.sh in ptxdist and which package type is appropriate. Is it a 
> ./ptx newpackage target or a src-cmake-prog as the autogen.sh makes use 
> of cmake.
> In the readme file is written, that to build the firmware one would need 
> a SH-2 toolchain. Is this also true for cross-compilation? Do I really 
> need to build this toolchain first?

The firmware is the code that runs *inside* your Wifi chip, and
apparently this Wifi chip uses a SuperH 2 processor. So, regardless of
whether your embedded system uses a ARM processor, a x86 processor, or
something else, your USB Wifi device embeds a SH2 processor, and the
firmware is targeting this processor, not your main application
processor (ARM i.MX53 in your case).

So again, unless you need to make modifications to the firmware, I
would probably recommend to go with a pre-built version.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] Crosscompile a WIFI USB stick firmware with ptxdist
  2012-12-27 14:01 ` Thomas Petazzoni
@ 2012-12-28 10:00   ` Josef Holzmayr
  2012-12-28 16:05     ` Robert Schwebel
  0 siblings, 1 reply; 4+ messages in thread
From: Josef Holzmayr @ 2012-12-28 10:00 UTC (permalink / raw)
  To: ptxdist

From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> So again, unless you need to make modifications to the firmware, I
> would probably recommend to go with a pre-built version.

Yes, I would strongly recommend exactly the same.
On the other hand, I am thinking at the moment about a constellation
where I have a cortex a9 and a cortex m3 in AMP configuration, and the m3
firmware is also "under development" or project specific as you put it, and not some
binary blob. So what might be suggestions here?

So far I've come up with
a) two separate build processes / ptxdist projects
b) make the m3 build configurable through .in file options and then build by Makefile
c) ???

A penny for your thoughts ;)

Joe


-- 
_____________________________________________________________
R-S-I Elektrotechnik GmbH & Co. KG
Woelkestrasse 11
D-85301 Schweitenkirchen
Fon: +49 8444 9204-0
Fax: +49 8444 9204-50
www.rsi-elektrotechnik.de

_____________________________________________________________
Amtsgericht Ingolstadt - GmbH: HRB 191328 - KG: HRA 170363
Geschäftsführer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg
USt-IdNr.: DE 128592548


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] Crosscompile a WIFI USB stick firmware with ptxdist
  2012-12-28 10:00   ` Josef Holzmayr
@ 2012-12-28 16:05     ` Robert Schwebel
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Schwebel @ 2012-12-28 16:05 UTC (permalink / raw)
  To: ptxdist

On Fri, Dec 28, 2012 at 11:00:23AM +0100, Josef Holzmayr wrote:
> From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> > So again, unless you need to make modifications to the firmware, I
> > would probably recommend to go with a pre-built version.
>
> Yes, I would strongly recommend exactly the same.
> On the other hand, I am thinking at the moment about a constellation
> where I have a cortex a9 and a cortex m3 in AMP configuration, and the m3
> firmware is also "under development" or project specific as you put it, and not some
> binary blob. So what might be suggestions here?
>
> So far I've come up with
> a) two separate build processes / ptxdist projects
> b) make the m3 build configurable through .in file options and then build by Makefile
> c) ???
>
> A penny for your thoughts ;)

See rules/sw-ek-lm3s3748.{in,make} and rules/bare_metal.in for a similar
case with cortex-m3. If you put a DFU firmware loader into the M3 and
connect it via USB, you can even load the firmware in-system.

rsc
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-28 16:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-27 13:12 [ptxdist] Crosscompile a WIFI USB stick firmware with ptxdist Dr. Patrick Langfeld
2012-12-27 14:01 ` Thomas Petazzoni
2012-12-28 10:00   ` Josef Holzmayr
2012-12-28 16:05     ` Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox