
On Monday, August 29, 2011 07:34:12 Michal Simek wrote:
--- /dev/null +++ b/drivers/net/xilinx_ll_temac.c
+#include <asm/processor.h>
what do you need from this header ?
+#ifdef SDMA_MODE +static unsigned char tx_buffer[PKTSIZE_ALIGN ] __attribute((aligned(32))); +#endif +static unsigned char rx_buffer[PKTSIZE_ALIGN ] __attribute((aligned(32)));
no space before that "]"
+static inline void temac_out_be32(u32 addr, u32 offset, u32 val) +{
- out_be32((u32 *)(addr + offset), val);
+}
+static inline u32 temac_in_be32(u32 addr, u32 offset) +{
- return in_be32((u32 *)(addr + offset));
+}
write a C struct describing the register layout, then your code can simply do: in_be32(®s->lsw0) and you don't need these two helpers
+static int xps_ll_temac_addr_setup(struct eth_device *dev) +{
- int val;
- /* set up unicast MAC address filter */
- val = ((dev->enetaddr[3] << 24) | (dev->enetaddr[2] << 16) |
(dev->enetaddr[1] << 8) | (dev->enetaddr[0]));
- xps_ll_temac_indirect_set(dev, 0, UAW0, val);
- val = (dev->enetaddr[5] << 8) | dev->enetaddr[4] ;
- xps_ll_temac_indirect_set(dev, 0, UAW1, val);
- return 0;
+}
this should be set to dev->write_hwaddr in the initialize func
+int xilinx_ll_temac_initialize(bd_t *bis, int base_addr)
the register base address really should be "unsigned long" and not "int" -mike