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-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 for %s 
-  to set RX CPU PC, 

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-10 Thread Faidon Liambotis
Robert Edmonds wrote:
  This package provides the source code for the tg3dfsg kernel
  module.  Kernel source or headers are required to compile this module.
 
 This driver complies with GR 2006-004 and should support all Tigon3
 hardware except for 5701a0 chipsets.  I intend to upload it should
 linux kernel images be uploaded which lack the tg3 driver.
This doesn't sound good.

Any reason why your 5701a0-removal patch can't be applied to our kernel
packages?
Or even better, why the driver can't be converted to use
request_firmware() instead of embedding the firmware to the source?

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 Robert Edmonds
Faidon Liambotis wrote:
 Robert Edmonds wrote:
  This package provides the source code for the tg3dfsg kernel
  module.  Kernel source or headers are required to compile this module.
 
 This driver complies with GR 2006-004 and should support all Tigon3
 hardware except for 5701a0 chipsets.  I intend to upload it should
 linux kernel images be uploaded which lack the tg3 driver.
 This doesn't sound good.

 Any reason why your 5701a0-removal patch can't be applied to our kernel
 packages?

 Or even better, why the driver can't be converted to use
 request_firmware() instead of embedding the firmware to the source?

There are three hunks of firmware code in the tg3 driver; the other two
enable TSO on chipsets which lack TSO firmware in silicon, but AFAIK
these chips should function without TSO.  (In fact, TSO has been
disabled in this driver in the past.)

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).

Obviously, since I and many other users have computers with embedded
Tigon3 hardware, I would be delighted if this package were unnecessary.

[0] http://wiki.debian.org/DebianKernelPatchAcceptanceGuidelines
[1] http://article.gmane.org/gmane.linux.debian.devel.kernel/32543/
[2] http://tinyurl.com/36xr2b, http://tinyurl.com/2u2cu5

-- 
Robert Edmonds
[EMAIL PROTECTED]


signature.asc
Description: Digital signature


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 Daniel Schepler
On Wednesday 10 October 2007 02:57:59 pm Robert Edmonds wrote:
 The only rationale for removing the *firmware* is compliance with GR
 2006-004...

Reading this feels about like reading someone write, The only rationale for 
not smoking cigarettes in this restaurant is compliance with state law.

How about not suggesting that the majority of Debian developers who voted for 
that GR were crazy people making a decision with no rational basis?  You 
might disagree with it, but at least try to understand that there was a 
reason for it that seemed valid to a lot of people.
-- 
Daniel Schepler


-- 
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, Daniel Schepler [EMAIL PROTECTED] wrote:
 On Wednesday 10 October 2007 02:57:59 pm Robert Edmonds wrote:
 The only rationale for removing the *firmware* is compliance with GR
 2006-004...

 Reading this feels about like reading someone write, The only rationale for 
 not smoking cigarettes in this restaurant is compliance with state law.

 How about not suggesting that the majority of Debian developers who voted for 
 that GR were crazy people making a decision with no rational basis?  You 
 might disagree with it, but at least try to understand that there was a 
 reason for it that seemed valid to a lot of people.

s/voted for/voted on/

-- 
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-10 Thread Bastian Blank
On Wed, Oct 10, 2007 at 08:41:13AM +0300, Faidon Liambotis wrote:
 Any reason why your 5701a0-removal patch can't be applied to our kernel
 packages?

None, at least from my point of view. Just someone have to do it. (See
[EMAIL PROTECTED] on d-kernel.)

Bastian

-- 
There are some things worth dying for.
-- Kirk, Errand of Mercy, stardate 3201.7


-- 
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_firmware fails for %s 
-  to set 

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

2007-10-09 Thread Robert Edmonds
Package: wnpp
Owner: Robert S. Edmonds [EMAIL PROTECTED]
Severity: wishlist

* Package name: tg3dfsg
  Version : 3.81
  Upstream Author : Various
* URL : http://people.debian.org/~edmonds/tg3dfsg/
* License : GPLv2
  Programming Lang: C
  Description : firmware free Broadcom Tigon3 network driver

 This package provides the source code for the tg3dfsg kernel
 module.  Kernel source or headers are required to compile this module.

This driver complies with GR 2006-004 and should support all Tigon3
hardware except for 5701a0 chipsets.  I intend to upload it should
linux kernel images be uploaded which lack the tg3 driver.

-- 
Robert Edmonds
[EMAIL PROTECTED]


signature.asc
Description: Digital signature