Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-10 Thread Robert Edmonds
Faidon Liambotis wrote:
> Robert Edmonds wrote:
> > Any modification to the tg3 driver to produce a GR 2006-004 compliant
> > driver would have to diverge from the kernel team's patch acceptance
> > guidelines[0] since upstream is intransigent[1] on making tg3
> > firmware-free or firmware-optional.  The kernel team does not appear to
> > be interested in maintaining such a driver, and it appears future linux
> > kernel source packages will be patched[2] to simply remove the blobs of
> > firmware (I don't know why the driver isn't simply removed entirely
> > since the result does not compile).
> This seems totally inappropriate.
> 
> If the driver includes non-free firmwares these should be removed or
> split up from the driver source, not remove the driver entirely.
> If what you say is right, the driver *works* for most of the hardware
> without non-free blobs.
> Therefore, I can't understand how removing the driver serves our users.

That is why I said "appear", since I hope that the kernel team has plans
for the driver beyond simply eliding it.

(I'd like to point out that the equivalent FreeBSD if_bge driver has no
firmware blobs.)

> Any rationale behind that decision?
> I feel like I'm arguing for something completely obvious...

The only rationale for removing the *firmware* is compliance with GR
2006-004...

-- 
Robert Edmonds
[EMAIL PROTECTED]


signature.asc
Description: Digital signature


Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-10 Thread Faidon Liambotis
Robert Edmonds wrote:
> Any modification to the tg3 driver to produce a GR 2006-004 compliant
> driver would have to diverge from the kernel team's patch acceptance
> guidelines[0] since upstream is intransigent[1] on making tg3
> firmware-free or firmware-optional.  The kernel team does not appear to
> be interested in maintaining such a driver, and it appears future linux
> kernel source packages will be patched[2] to simply remove the blobs of
> firmware (I don't know why the driver isn't simply removed entirely
> since the result does not compile).
This seems totally inappropriate.

If the driver includes non-free firmwares these should be removed or
split up from the driver source, not remove the driver entirely.
If what you say is right, the driver *works* for most of the hardware
without non-free blobs.
Therefore, I can't understand how removing the driver serves our users.

Any rationale behind that decision?
I feel like I'm arguing for something completely obvious...

Regards,
Faidon


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-10 Thread Bastian Blank
On Thu, Oct 11, 2007 at 12:44:54AM +0200, Bastian Blank wrote:
> None, at least from my point of view. Just someone have to do it. (See
> <[EMAIL PROTECTED]> on d-kernel.)

The attached patch should apply on the pruned version.

Bastian

-- 
We have found all life forms in the galaxy are capable of superior
development.
-- Kirk, "The Gamesters of Triskelion", stardate 3211.7
--- tg3.c.orig  2007-10-10 16:13:59.0 +0200
+++ tg3.c   2007-10-11 01:01:49.0 +0200
@@ -5124,11 +5124,6 @@
 }
 
 
-#define RX_CPU_SCRATCH_BASE0x3
-#define RX_CPU_SCRATCH_SIZE0x04000
-#define TX_CPU_SCRATCH_BASE0x34000
-#define TX_CPU_SCRATCH_SIZE0x04000
-
 /* tp->lock is held. */
 static int tg3_halt_cpu(struct tg3 *tp, u32 offset)
 {
@@ -5177,205 +5172,6 @@
return 0;
 }
 
-struct fw_info {
-   unsigned int text_base;
-   unsigned int text_len;
-   const u32 *text_data;
-   unsigned int rodata_base;
-   unsigned int rodata_len;
-   const u32 *rodata_data;
-   unsigned int data_base;
-   unsigned int data_len;
-   const u32 *data_data;
-};
-
-/* tp->lock is held. */
-static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 
cpu_scratch_base,
-int cpu_scratch_size, struct fw_info *info)
-{
-   int err, lock_err, i;
-   void (*write_op)(struct tg3 *, u32, u32);
-
-   if (cpu_base == TX_CPU_BASE &&
-   (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
-   printk(KERN_ERR PFX "tg3_load_firmware_cpu: Trying to load "
-  "TX cpu firmware on %s which is 5705.\n",
-  tp->dev->name);
-   return -EINVAL;
-   }
-
-   if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
-   write_op = tg3_write_mem;
-   else
-   write_op = tg3_write_indirect_reg32;
-
-   /* It is possible that bootcode is still loading at this point.
-* Get the nvram lock first before halting the cpu.
-*/
-   lock_err = tg3_nvram_lock(tp);
-   err = tg3_halt_cpu(tp, cpu_base);
-   if (!lock_err)
-   tg3_nvram_unlock(tp);
-   if (err)
-   goto out;
-
-   for (i = 0; i < cpu_scratch_size; i += sizeof(u32))
-   write_op(tp, cpu_scratch_base + i, 0);
-   tw32(cpu_base + CPU_STATE, 0x);
-   tw32(cpu_base + CPU_MODE, tr32(cpu_base+CPU_MODE)|CPU_MODE_HALT);
-   for (i = 0; i < (info->text_len / sizeof(u32)); i++)
-   write_op(tp, (cpu_scratch_base +
- (info->text_base & 0x) +
- (i * sizeof(u32))),
-(info->text_data ?
- info->text_data[i] : 0));
-   for (i = 0; i < (info->rodata_len / sizeof(u32)); i++)
-   write_op(tp, (cpu_scratch_base +
- (info->rodata_base & 0x) +
- (i * sizeof(u32))),
-(info->rodata_data ?
- info->rodata_data[i] : 0));
-   for (i = 0; i < (info->data_len / sizeof(u32)); i++)
-   write_op(tp, (cpu_scratch_base +
- (info->data_base & 0x) +
- (i * sizeof(u32))),
-(info->data_data ?
- info->data_data[i] : 0));
-
-   err = 0;
-
-out:
-   return err;
-}
-
-/* tp->lock is held. */
-static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
-{
-   struct fw_info info;
-   int err, i;
-
-   info.text_base = TG3_FW_TEXT_ADDR;
-   info.text_len = TG3_FW_TEXT_LEN;
-   info.text_data = &tg3FwText[0];
-   info.rodata_base = TG3_FW_RODATA_ADDR;
-   info.rodata_len = TG3_FW_RODATA_LEN;
-   info.rodata_data = &tg3FwRodata[0];
-   info.data_base = TG3_FW_DATA_ADDR;
-   info.data_len = TG3_FW_DATA_LEN;
-   info.data_data = NULL;
-
-   err = tg3_load_firmware_cpu(tp, RX_CPU_BASE,
-   RX_CPU_SCRATCH_BASE, RX_CPU_SCRATCH_SIZE,
-   &info);
-   if (err)
-   return err;
-
-   err = tg3_load_firmware_cpu(tp, TX_CPU_BASE,
-   TX_CPU_SCRATCH_BASE, TX_CPU_SCRATCH_SIZE,
-   &info);
-   if (err)
-   return err;
-
-   /* Now startup only the RX cpu. */
-   tw32(RX_CPU_BASE + CPU_STATE, 0x);
-   tw32_f(RX_CPU_BASE + CPU_PC,TG3_FW_TEXT_ADDR);
-
-   for (i = 0; i < 5; i++) {
-   if (tr32(RX_CPU_BASE + CPU_PC) == TG3_FW_TEXT_ADDR)
-   break;
-   tw32(RX_CPU_BASE + CPU_STATE, 0x);
-   tw32(RX_CPU_BASE + CPU_MODE,  CPU_MODE_HALT);
-   tw32_f(RX_CPU_BASE + CPU_PC,TG3_FW_TEXT_ADDR);
-   udelay(1000);
-   }
-   if (i >= 5) {
-   printk(KERN_ERR PFX "tg3_load_firmwar

Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-10 Thread maximilian attems
On Thu, Oct 11, 2007 at 01:04:56AM +0200, Bastian Blank wrote:
> On Thu, Oct 11, 2007 at 12:44:54AM +0200, Bastian Blank wrote:
> > None, at least from my point of view. Just someone have to do it. (See
> > <[EMAIL PROTECTED]> on d-kernel.)
> 
> The attached patch should apply on the pruned version.
> 
> Bastian

where is the request_firmware() usage?

-- 
maks


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-10 Thread Robert Edmonds
On 2007-10-10, Bastian Blank <[EMAIL PROTECTED]> wrote:
> The attached patch should apply on the pruned version.

Applies but does not compile:

tg3.c: In function ‘tg3_reset_hw’:
tg3.c:5399: error: ‘TG3_TSO5_FW_TEXT_LEN’ undeclared (first use in this 
function)
tg3.c:5399: error: (Each undeclared identifier is reported only once
tg3.c:5399: error: for each function it appears in.)
tg3.c:5400: error: ‘TG3_TSO5_FW_RODATA_LEN’ undeclared (first use in this 
function)
tg3.c:5401: error: ‘TG3_TSO5_FW_DATA_LEN’ undeclared (first use in this 
function)
tg3.c:5402: error: ‘TG3_TSO5_FW_SBSS_LEN’ undeclared (first use in this 
function)
tg3.c:5403: error: ‘TG3_TSO5_FW_BSS_LEN’ undeclared (first use in this 
function)

The offending code is:

/* Initialize MBUF/DESC pool. */
if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS) {
/* Do nothing.  */
} else if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705) {
[...]
}
else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) {
int fw_len;

fw_len = (TG3_TSO5_FW_TEXT_LEN +
  TG3_TSO5_FW_RODATA_LEN +
  TG3_TSO5_FW_DATA_LEN +
  TG3_TSO5_FW_SBSS_LEN +
  TG3_TSO5_FW_BSS_LEN);
fw_len = (fw_len + (0x80 - 1)) & ~(0x80 - 1);
tw32(BUFMGR_MB_POOL_ADDR,
 NIC_SRAM_MBUF_POOL_BASE5705 + fw_len);
tw32(BUFMGR_MB_POOL_SIZE,
 NIC_SRAM_MBUF_POOL_SIZE5705 - fw_len - 0xa00);
}

-- 
Robert Edmonds
[EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-11 Thread Per Olofsson
Hi,

Robert Edmonds wrote:
> The only rationale for removing the *firmware* is compliance with GR
> 2006-004...

Am I missing something here? Didn't that GR fail?

http://www.debian.org/vote/2006/vote_004

-- 
Pelle


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-11 Thread Bastian Blank
On Thu, Oct 11, 2007 at 12:44:24AM +, Robert Edmonds wrote:
> On 2007-10-10, Bastian Blank <[EMAIL PROTECTED]> wrote:
> > The attached patch should apply on the pruned version.
> Applies but does not compile:

Yep. Fixed. There are some magic constants in the code ...

Bastian

-- 
Knowledge, sir, should be free to all!
-- Harry Mudd, "I, Mudd", stardate 4513.3
--- tg3.c.orig  2007-10-10 16:13:59.0 +0200
+++ tg3.c   2007-10-11 09:23:01.0 +0200
@@ -5124,11 +5124,6 @@
 }
 
 
-#define RX_CPU_SCRATCH_BASE0x3
-#define RX_CPU_SCRATCH_SIZE0x04000
-#define TX_CPU_SCRATCH_BASE0x34000
-#define TX_CPU_SCRATCH_SIZE0x04000
-
 /* tp->lock is held. */
 static int tg3_halt_cpu(struct tg3 *tp, u32 offset)
 {
@@ -5177,205 +5172,6 @@
return 0;
 }
 
-struct fw_info {
-   unsigned int text_base;
-   unsigned int text_len;
-   const u32 *text_data;
-   unsigned int rodata_base;
-   unsigned int rodata_len;
-   const u32 *rodata_data;
-   unsigned int data_base;
-   unsigned int data_len;
-   const u32 *data_data;
-};
-
-/* tp->lock is held. */
-static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 
cpu_scratch_base,
-int cpu_scratch_size, struct fw_info *info)
-{
-   int err, lock_err, i;
-   void (*write_op)(struct tg3 *, u32, u32);
-
-   if (cpu_base == TX_CPU_BASE &&
-   (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
-   printk(KERN_ERR PFX "tg3_load_firmware_cpu: Trying to load "
-  "TX cpu firmware on %s which is 5705.\n",
-  tp->dev->name);
-   return -EINVAL;
-   }
-
-   if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
-   write_op = tg3_write_mem;
-   else
-   write_op = tg3_write_indirect_reg32;
-
-   /* It is possible that bootcode is still loading at this point.
-* Get the nvram lock first before halting the cpu.
-*/
-   lock_err = tg3_nvram_lock(tp);
-   err = tg3_halt_cpu(tp, cpu_base);
-   if (!lock_err)
-   tg3_nvram_unlock(tp);
-   if (err)
-   goto out;
-
-   for (i = 0; i < cpu_scratch_size; i += sizeof(u32))
-   write_op(tp, cpu_scratch_base + i, 0);
-   tw32(cpu_base + CPU_STATE, 0x);
-   tw32(cpu_base + CPU_MODE, tr32(cpu_base+CPU_MODE)|CPU_MODE_HALT);
-   for (i = 0; i < (info->text_len / sizeof(u32)); i++)
-   write_op(tp, (cpu_scratch_base +
- (info->text_base & 0x) +
- (i * sizeof(u32))),
-(info->text_data ?
- info->text_data[i] : 0));
-   for (i = 0; i < (info->rodata_len / sizeof(u32)); i++)
-   write_op(tp, (cpu_scratch_base +
- (info->rodata_base & 0x) +
- (i * sizeof(u32))),
-(info->rodata_data ?
- info->rodata_data[i] : 0));
-   for (i = 0; i < (info->data_len / sizeof(u32)); i++)
-   write_op(tp, (cpu_scratch_base +
- (info->data_base & 0x) +
- (i * sizeof(u32))),
-(info->data_data ?
- info->data_data[i] : 0));
-
-   err = 0;
-
-out:
-   return err;
-}
-
-/* tp->lock is held. */
-static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
-{
-   struct fw_info info;
-   int err, i;
-
-   info.text_base = TG3_FW_TEXT_ADDR;
-   info.text_len = TG3_FW_TEXT_LEN;
-   info.text_data = &tg3FwText[0];
-   info.rodata_base = TG3_FW_RODATA_ADDR;
-   info.rodata_len = TG3_FW_RODATA_LEN;
-   info.rodata_data = &tg3FwRodata[0];
-   info.data_base = TG3_FW_DATA_ADDR;
-   info.data_len = TG3_FW_DATA_LEN;
-   info.data_data = NULL;
-
-   err = tg3_load_firmware_cpu(tp, RX_CPU_BASE,
-   RX_CPU_SCRATCH_BASE, RX_CPU_SCRATCH_SIZE,
-   &info);
-   if (err)
-   return err;
-
-   err = tg3_load_firmware_cpu(tp, TX_CPU_BASE,
-   TX_CPU_SCRATCH_BASE, TX_CPU_SCRATCH_SIZE,
-   &info);
-   if (err)
-   return err;
-
-   /* Now startup only the RX cpu. */
-   tw32(RX_CPU_BASE + CPU_STATE, 0x);
-   tw32_f(RX_CPU_BASE + CPU_PC,TG3_FW_TEXT_ADDR);
-
-   for (i = 0; i < 5; i++) {
-   if (tr32(RX_CPU_BASE + CPU_PC) == TG3_FW_TEXT_ADDR)
-   break;
-   tw32(RX_CPU_BASE + CPU_STATE, 0x);
-   tw32(RX_CPU_BASE + CPU_MODE,  CPU_MODE_HALT);
-   tw32_f(RX_CPU_BASE + CPU_PC,TG3_FW_TEXT_ADDR);
-   udelay(1000);
-   }
-   if (i >= 5) {
-   printk(KERN_ERR PFX "tg3_load_firmware fails fo

Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-11 Thread Ben Hutchings
On Thu, 2007-10-11 at 09:42 +0200, Per Olofsson wrote:
> Hi,
> 
> Robert Edmonds wrote:
> > The only rationale for removing the *firmware* is compliance with GR
> > 2006-004...
> 
> Am I missing something here? Didn't that GR fail?
> 
> http://www.debian.org/vote/2006/vote_004

There's no need for a resolution to decide that executable machine code
- whether or not you call it "firmware"[1] - is software.  The relevant
GR is 2006-007, which decided against making a permanent exception for
"firmware" in the kernel.

[1] The term "firmware" should apply only to software that is installed
in non-volatile memory such as ROM or flash, which Debian does not need
to distribute.  What we're talking about here is software for peripheral
processors.

Ben.

-- 
Ben Hutchings
The program is absolutely right; therefore, the computer must be wrong.


signature.asc
Description: This is a digitally signed message part


Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-25 Thread Bastian Blank
On Thu, Oct 11, 2007 at 01:16:43AM +0200, maximilian attems wrote:
> > The attached patch should apply on the pruned version.
> where is the request_firmware() usage?

Nowhere.

Bastian

-- 
Schshschshchsch.
-- The Gorn, "Arena", stardate 3046.2


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-25 Thread Bastian Blank
On Thu, Oct 11, 2007 at 10:19:18AM +0200, Bastian Blank wrote:
> Yep. Fixed. There are some magic constants in the code ...

Assuming okay.

Bastian

-- 
Lots of people drink from the wrong bottle sometimes.
-- Edith Keeler, "The City on the Edge of Forever",
   stardate unknown


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-25 Thread maximilian attems
On Thu, Oct 25, 2007 at 11:51:58PM +0200, Bastian Blank wrote:
> On Thu, Oct 11, 2007 at 01:16:43AM +0200, maximilian attems wrote:
> > > The attached patch should apply on the pruned version.
> > where is the request_firmware() usage?
> 
> Nowhere.

yup the patch is not complete nor upstream quality.
you remove functionality.

-- 
maks


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-25 Thread Bastian Blank
On Fri, Oct 26, 2007 at 12:17:09AM +0200, maximilian attems wrote:
> yup the patch is not complete nor upstream quality.

And?

> you remove functionality.

What do you want to say?

Bastian

-- 
Power is danger.
-- The Centurion, "Balance of Terror", stardate 1709.2


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Bug#446028: ITP: tg3dfsg -- firmware free Broadcom Tigon3 network driver

2007-10-25 Thread maximilian attems
On Fri, Oct 26, 2007 at 12:45:22AM +0200, Bastian Blank wrote:
> On Fri, Oct 26, 2007 at 12:17:09AM +0200, maximilian attems wrote:
> > yup the patch is not complete nor upstream quality.
> 
> And?

highly questionable thus.
 
> > you remove functionality.
> 
> What do you want to say?

stop playing dumb ass,
some boards needs the request_firmware() to actually work.
also the tg3 firmware in kernel is pretty good and stable.
(bnx2 seems much more fluctuating as newer on quick git check)

-- 
maks
 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]