I have a carambola2 which I build FreeBSD using freebsd-wifi-build.
The kernel fails to read the uboot environment, producing the following errors:
argv is invalid
envp is invalid
I tracked this down to sys/mips/.atheros/ar71xx_machdep.c and the following code fragment:
* Until some more sensible abstractions for uboot/redboot
* environment handling, we have to make this a compile-time
* hack. The existing code handles the uboot environment
* very incorrectly so we should just ignore initialising
* the relevant pointers.
argc = a0;
argv = (char**)a1;
envp = (char**)a2;
For the Carambola2, those registers are in fact accurate and should not be #ifdef'd out. However, the variables are in fact an array of strings of "name=value" not pairs of strings "name", "value", so to fix this for my own case I had to extend the code that parses them later in the file.
Notwithstanding the comment regards 'more sensible abstractions', I have a patch that makes the variables work (for the carambola2, at least)
However, I suspect you may wish to restrict this fix to _just_ the carambola2 board, lest it break other peoples systems. Any advice on how to filter a fragment of code to a specific kernel configuration would be appreciated, as I am mostly experienced with hacking other systems kernels...