On Tue, Jun 28, 2011 at 5:54 PM, Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> wrote:
2-3-add_arm_isms.patch
Have you checked with an architecture guru that sync_primitive() can
really be empty, not only for that arch in general, but also for
accesses to a mmapped region the way flashrom does it?

Nope. Scattered resources/forum posts about ARMv7 suggest that peripheral memory is strongly ordered. Also, the U-Boot code doesn't have special handling for sync primitives AFAICT.

I'm pretty new to ARM... Any advice from experts on this list would be appreciated.

On Tue, Jun 28, 2011 at 5:54 PM, Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> wrote: 
3-3-add_tegra2_spi_controller.patch
Not your fault, but we really need a way to detect the target
architecture in the Makefile. The issues of which SPI masters to include
for internal exists on all architectures. Any ideas? I experimented with
uname calls in the past, but that checks the host arch, not the target
arch. Grepping the preprocessor output for the compiler might be an option.
echo|gcc -dM -E -|grep "whatever\|arch\|defines"
Or you try this pretty straightforward solution:

Create a file arch.h with these contents:
#if defined (__i386__)
#define __FLASHROM_ARCH__ "x86"
#elif defined (__x86_64__)
#define __FLASHROM_ARCH__ "x86_64"
#elif defined (__mips) || defined (__mips__) || defined (_mips) ||
defined (mips)
#define __FLASHROM_ARCH__ "mips"
#elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__)
|| defined(__ppc64__)
#define __FLASHROM_ARCH__ "ppc"
#endif
__FLASHROM_ARCH__

Then run
gcc -E arch.h|grep -v ^#
The result on my machine will be
"x86"
Side note: Such an arch.h file (with some extensions) might save us from
having to check every possible arch define everywhere we need to
differentiate between architectures.

I will comment on the Tegra2 SPI driver later, we should get the
infrastructure questions addressed first.

I've updated this patch set on top of the other patches you've been working on (autodetect target processor and the libpci hack).

The difference between this patchset and the previous one is pretty minor. We can now discard the first patch which #ifdef'd out PCI code for ARM targets. The remaining differences are mostly centered around the Makefile and arch.h

New patches are:
Signed-off-by: David Hendricks <dhendrix@google.com>

--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.