Re: [PATCH 01/15] [PS3] Add udbg driver using the PS3 gelic Ethernet device
flat view
From: Andre Heider <hidden>
Date: 2011-08-04 16:35:53
On Thu, Aug 4, 2011 at 12:32 AM, Geoff Levand [off-list ref] wrote:
On 08/01/2011 01:02 PM, Andre Heider wrote:quoted
--- /dev/null +++ b/arch/powerpc/platforms/ps3/gelic_udbg.c@@ -0,0 +1,272 @@ +/* + * arch/powerpc/platforms/ps3/gelic_udbg.cDon't put file names in files. =A0When the file gets moved, then this wil=
l
no longer be correct.quoted
+ * + * udbg debug output routine via GELIC UDP broadcasts + * Copyright (C) 2010 Hector Martin <hector@marcansoft.com> + * Copyright (C) 2011 Andre Heider <a.heider@gmail.com>Some of this seems to be taken from the gelic driver, so shouldn't the copyright info from there be included here?quoted
+ * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + */ + +#include <asm/io.h> +#include <asm/udbg.h> +#include <asm/lv1call.h> + +#define GELIC_BUS_ID 1 +#define GELIC_DEVICE_ID 0 +#define GELIC_DEBUG_PORT 18194 +#define GELIC_MAX_MESSAGE_SIZE 1000 + +#define GELIC_LV1_GET_MAC_ADDRESS 1 +#define GELIC_LV1_GET_VLAN_ID 4 +#define GELIC_LV1_VLAN_TX_ETHERNET_0 2 + +#define GELIC_DESCR_DMA_STAT_MASK 0xf0000000 +#define GELIC_DESCR_DMA_CARDOWNED 0xa0000000 + +#define GELIC_DESCR_TX_DMA_IKE 0x00080000 +#define GELIC_DESCR_TX_DMA_NO_CHKSUM 0x00000000 +#define GELIC_DESCR_TX_DMA_FRAME_TAIL 0x00040000 + +#define GELIC_DESCR_DMA_CMD_NO_CHKSUM (GELIC_DESCR_DMA_CARDOWNED | \ + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0GELIC_DESCR_TX_DMA_IKE | \
quoted
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0GELIC_DESCR_TX_DMA_NO_CHKSUM)
quoted
+ +static u64 bus_addr; + +struct gelic_descr { + =A0 =A0 /* as defined by the hardware */These are BE from the hardware, so should be __beXX types.quoted
+ =A0 =A0 u32 buf_addr; + =A0 =A0 u32 buf_size; + =A0 =A0 u32 next_descr_addr; + =A0 =A0 u32 dmac_cmd_status; + =A0 =A0 u32 result_size; + =A0 =A0 u32 valid_size; /* all zeroes for tx */ + =A0 =A0 u32 data_status; + =A0 =A0 u32 data_error; /* all zeroes for tx */ +} __attribute__((aligned(32)));...quoted
+static void gelic_debug_init(void) +{...quoted
+ =A0 =A0 result =3D lv1_net_control(GELIC_BUS_ID, GELIC_DEVICE_ID, + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0GELIC_LV1_G=
ET_VLAN_ID,
quoted
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0GELIC_LV1_V=
LAN_TX_ETHERNET_0, 0, 0,
quoted
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&vlan_id, &=
v2);
quoted
+ =A0 =A0 if (result =3D=3D 0) {This should be 'if (!result)'
Ack on all points.