Atari EtherNAT/EtherNEC/NetUSBee support
Subsystems (7)
cover Atari EtherNAT/EtherNEC/NetUSBee support
Hi Geert,
here's my rewrite of the Atari patch series for upstream submission - the only changes are to patches 9 and 12.
The USB patch no longer disables the chip interrupt in the interrupt handler - it turns out this wasn't necessary at all. It also does away with direct writes to the EtherNAT interrupt control register, and uses enable_irq() and disable_irq() instead. The probe code has become a lot cleaner as a result.
Defering interrupt enable until HCD start callback time is still necessary though - if interrups are enabled when the handler is registered from usb_hcd_add, the dead interrupt watchdog fires and disables the interrupt again. This may be a result of the handler returning IRQ_NONE if the chip hasn't been started yet - I need to look into that.
01/12 m68k/atari: ROM port ISA adapter support
02/12 m68k/irq: Add handle_polled_irq() for timer based soft interrupts 03/12 m68k/atari: use dedicated irq_chip for timer D interrupts 04/12 m68k/atari: use polled interrupt handler for timer D interrupts 05/12 m68k/atari: EtherNAT - platform device and IRQ support code 06/12 m68k/atari: EtherNEC - add platform device support
07/12 m68k/atari: EtherNAT - ethernet support - new driver (smc91x) 08/12 m68k/atari: EtherNEC - ethernet support - new driver (ne.c) 09/12 m68k/atari: EtherNAT - add interrupt chip definition for CPLD interrupts 10/12 m68k: Implement ndelay() based on the existing udelay() logic 11/12 m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCD 12/12 m68k/atari: USB - add ISP1160 USB host controller support
Cheers,
Michael
PATCH 1/12 m68k/atari: ROM port ISA adapter support
From: Michael Schmitz <[email protected]>
Atari ROM port ISA adapter support for EtherNEC and NetUSBee adapters
16 bit access for ROM port adapters follows debugging and clarification by David Galvez <[email protected]>. The NetUSBee ISP1160 USB chip uses these macros.
--- arch/m68k/Kconfig.bus | 10 +++ arch/m68k/include/asm/io_mm.h | 136 ++++++++++++++++++++++++++++++++++++++-- arch/m68k/include/asm/raw_io.h | 109 +++++++++++++++++++++++++++++++- arch/m68k/kernel/setup_mm.c | 6 ++ 4 files changed, 254 insertions(+), 7 deletions(-)
arch/m68k/Kconfig.bus +10 -0
@@ -45,6 +45,16 @@ config ISA (MCA) or VESA. ISA is an older system, now being displaced by PCI; newer boards don't support it. If you have ISA, say Y, otherwise N. +config ATARI_ROM_ISA + bool "Atari ROM port ISA adapter support" + depends on ATARI + help + This option enables support for the ROM port ISA adapter used to + operate ISA cards on Atari. Only 8 bit cards are supported, and + no interrupt lines are connected. + The only driver currently using this adapter is the EtherNEC + driver for RTL8019AS based NE2000 compatible network cards. + config GENERIC_ISA_DMA def_bool ISA
arch/m68k/include/asm/io_mm.h +130 -6
214 lines not on this page · raw message
arch/m68k/include/asm/raw_io.h +108 -1
127 lines not on this page · raw message
arch/m68k/kernel/setup_mm.c +6 -0
@@ -381,6 +381,12 @@ void __init setup_arch(char **cmdline_p) isa_sex =1 ; }#endif +#ifdef CONFIG_ATARI_ROM_ISA +if (MACH_IS_ATARI ) { + isa_type =ISA_TYPE_ENEC ; + isa_sex =0 ; + } +#endif #endif }
Signature · 1 line
1.7.0.4
PATCH 2/12 m68k/irq: Add handle_polled_irq() for timer based soft interrupts
In reply to Michael SchmitzExperimental hack to avoid unhandled interrupt timer to fire on EtherNEC/NetUSBee cards that have no hardware interrupt and need to be polled from a timer interrupt.
This patch adds a special 'polled interrupt' handler for timer based software interrupts.
handle_simple_irq() will respond to excessive unhandled interrupts (as are expected for a polling timer interrupt) by disabling the apparently unhandled interrupt source.
handle_polled_irq() prevents this by setting the IRQS_POLL_INPROGRESS flag which will cause the unhandled interrupt events to be ignored.
This is a temporary hack to allow timer based polling of the Atari ROM port network and USB cards only. Suggestions on how to properly handle this in the normal interrupt framework are most welcome.
--- include/linux/irq.h | 1 + kernel/irq/chip.c | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-)
include/linux/irq.h +1 -0
@@ -407,6 +407,7 @@ extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc);extern void handle_edge_irq (unsigned int irq,struct irq_desc *desc);extern void handle_edge_eoi_irq (unsigned int irq,struct irq_desc *desc);extern void handle_simple_irq (unsigned int irq,struct irq_desc *desc); +extern void handle_polled_irq (unsigned int irq,struct irq_desc *desc);extern void handle_percpu_irq (unsigned int irq,struct irq_desc *desc);extern void handle_percpu_devid_irq (unsigned int irq,struct irq_desc *desc);extern void handle_bad_irq (unsigned int irq,struct irq_desc *desc);
kernel/irq/chip.c +36 -0
@@ -353,6 +353,42 @@ out_unlock: }EXPORT_SYMBOL_GPL (handle_simple_irq); +/** +* handle_polled_irq - Simple and software-decoded IRQs. +* @irq: the interrupt number +* @desc: the interrupt description structure for this irq +* +* Polled interrupts are sent from a demultiplexing software interrupt +* handler, where no interrupt hardware control is necessary. +*/ +void +handle_polled_irq (unsigned int irq,struct irq_desc *desc) +{ +raw_spin_lock (&desc->lock); + +if (unlikely (irqd_irq_inprogress (&desc->irq_data))) +if (!irq_check_poll (desc)) + goto out_unlock; + + desc->istate &= ~(IRQS_REPLAY |IRQS_WAITING ); +kstat_incr_irqs_this_cpu (irq, desc); + +if (unlikely (!desc->action ||irqd_irq_disabled (&desc->irq_data))) { + desc->istate |=IRQS_PENDING ; + goto out_unlock; + } + + desc->istate |=IRQS_POLL_INPROGRESS ; + +handle_irq_event (desc); + + desc->istate &= ~(IRQS_POLL_INPROGRESS ); + +out_unlock: +raw_spin_unlock (&desc->lock); +} +EXPORT_SYMBOL_GPL (handle_polled_irq); +/* * Called unconditionally from handle_level_irq() and only for oneshot * interrupts from handle_fasteoi_irq()
Signature · 1 line
1.7.0.4
PATCH 3/12 m68k/atari: use dedicated irq_chip for timer D interrupts
In reply to Michael SchmitzAdd a special irq_chip for the Atari MFP timer D interrupt, which is used as a polling timer for EtherNEC and NetUSBee
--- arch/m68k/atari/ataints.c | 70 +++++++++++++++++++++++++++++++++++++ arch/m68k/include/asm/atariints.h | 9 +++++ 2 files changed, 79 insertions(+), 0 deletions(-)
arch/m68k/atari/ataints.c +70 -0
@@ -122,6 +122,62 @@ static struct irq_chip atari_irq_chip = { };/* +* ST-MFP timer D chained interrupts - each driver gets its own timer +* interrupt instance. +*/ + +struct mfptimerbase { +volatile struct MFP *mfp; +unsigned char mfp_mask, mfp_data; +unsigned short int_mask; +int handler_irq, mfptimer_irq, server_irq; +char *name; +} stmfp_base = { + .mfp = &st_mfp, + .int_mask =0x0 , + .handler_irq =IRQ_MFP_TIMD , + .mfptimer_irq =IRQ_MFP_TIMER1 , + .name ="MFP Timer D" +}; + +static irqreturn_t mfptimer_handler (int irq,void *dev_id) +{ +struct mfptimerbase *base = dev_id; +int mach_irq; +unsigned char ints; + + mach_irq = base->mfptimer_irq; + ints = base->int_mask; +for (; ints; mach_irq++, ints >>=1 ) { +if (ints &1 ) +generic_handle_irq (mach_irq); + } +return IRQ_HANDLED ; +} + + +static void atari_mfptimer_enable (struct irq_data *data) +{ +int mfp_num = data->irq -IRQ_MFP_TIMER1 ; + stmfp_base.int_mask |=1 << mfp_num; +atari_enable_irq (IRQ_MFP_TIMD ); +} + +static void atari_mfptimer_disable (struct irq_data *data) +{ +int mfp_num = data->irq -IRQ_MFP_TIMER1 ; + stmfp_base.int_mask &= ~(1 << mfp_num); +if (!stmfp_base.int_mask) +atari_disable_irq (IRQ_MFP_TIMD ); +} + +static struct irq_chip atari_mfptimer_chip = { + .name ="timer_d" , + .irq_enable = atari_mfptimer_enable, + .irq_disable = atari_mfptimer_disable, +}; + +/* * void atari_init_IRQ (void) * * Parameters: None
@@ -198,6 +254,20 @@ void __init atari_init_IRQ(void)/* Initialize the PSG: all sounds off, both ports output */ sound_ym.rd_data_reg_sel =7 ; sound_ym.wd_data =0xff ; + +m68k_setup_irq_controller (&atari_mfptimer_chip, handle_simple_irq, +IRQ_MFP_TIMER1 ,8 ); + +/* prepare timer D data for use as poll interrupt */ +/* set Timer D data Register - needs to be > 0 */ + st_mfp.tim_dt_d =254 ;/* < 100 Hz */ +/* start timer D, div = 1:100 */ + st_mfp.tim_ct_cd = (st_mfp.tim_ct_cd &0xf0 ) |0x6 ; + +/* request timer D dispatch handler */ +if (request_irq (IRQ_MFP_TIMD , mfptimer_handler,IRQF_SHARED , + stmfp_base.name, &stmfp_base)) +pr_err ("Couldn't register %s interrupt\n" , stmfp_base.name); }
arch/m68k/include/asm/atariints.h +9 -0
@@ -94,6 +94,15 @@#define IRQ_SCCA_RX (52)#define IRQ_SCCA_SPCOND (54) +/* shared MFP timer D interrupts - hires timer for EtherNEC et al. */ +#define IRQ_MFP_TIMER1 (64) +#define IRQ_MFP_TIMER2 (65) +#define IRQ_MFP_TIMER3 (66) +#define IRQ_MFP_TIMER4 (67) +#define IRQ_MFP_TIMER5 (68) +#define IRQ_MFP_TIMER6 (69) +#define IRQ_MFP_TIMER7 (70) +#define IRQ_MFP_TIMER8 (71)#define INT_CLK 24576/* CLK while int_clk =2.456MHz and divide = 100 */ #define INT_TICKS 246/* to make sched_time = 99.902... HZ */
Signature · 1 line
1.7.0.4
PATCH 4/12 m68k/atari: use polled interrupt handler for timer D interrupts
In reply to Michael SchmitzMake use of handle_polled_irq instead of handle_simple_irq for the MFP timer D interrupts - this avoids 'unhandled interrupt' messages and disabling of the timer interrupts after idle periods.
--- arch/m68k/atari/ataints.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/m68k/atari/ataints.c +1 -1
@@ -255,7 +255,7 @@ void __init atari_init_IRQ(void) sound_ym.rd_data_reg_sel =7 ; sound_ym.wd_data =0xff ; -m68k_setup_irq_controller (&atari_mfptimer_chip, handle_simple_irq, +m68k_setup_irq_controller (&atari_mfptimer_chip, handle_polled_irq,IRQ_MFP_TIMER1 ,8 );/* prepare timer D data for use as poll interrupt */
Signature · 1 line
1.7.0.4
PATCH 5/12 m68k/atari: EtherNAT - platform device and IRQ support code
In reply to Michael SchmitzAdd platform device and interrupt definitions necessary for the EtherNAT Ethernet/USB adapter for the Falcon extension port. EtherNAT interrupt numbers are 139/140 so the max. interrupt number for Atari has to be increased.
--- arch/m68k/atari/config.c | 62 +++++++++++++++++++++++++++++++++++++ arch/m68k/include/asm/atarihw.h | 6 +++ arch/m68k/include/asm/atariints.h | 2 +- arch/m68k/include/asm/irq.h | 6 +++- 4 files changed, 74 insertions(+), 2 deletions(-)
arch/m68k/atari/config.c +62 -0
@@ -31,6 +31,7 @@#include <linux/init.h> #include <linux/delay.h> #include <linux/ioport.h> +#include <linux/platform_device.h> #include <linux/vt_kern.h> #include <linux/module.h>
@@ -655,3 +656,64 @@ static void atari_get_hardware_list(struct seq_file *m)ATARIHW_ANNOUNCE (VME ,"VME Bus" );ATARIHW_ANNOUNCE (DSP56K ,"DSP56001 processor" ); } + +/* +* MSch: initial platform device support for Atari, +* required for EtherNAT/EtherNEC/NetUSBee drivers +*/ + +/* +* EtherNAT: SMC91C111 Ethernet chipset, handled by smc91x driver +*/ + +#define ATARI_ETHERNAT_IRQ 140 + +static struct resource smc91x_resources[] = { + [0 ] = { + .name ="smc91x-regs" , + .start =ATARI_ETHERNAT_PHYS_ADDR , + .end =ATARI_ETHERNAT_PHYS_ADDR +0xfffff , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .name ="smc91x-irq" , + .start =ATARI_ETHERNAT_IRQ , + .end =ATARI_ETHERNAT_IRQ , + .flags =IORESOURCE_IRQ , + }, +}; + +static struct platform_device smc91x_device = { + .name ="smc91x" , + .id =-1 , + .num_resources =ARRAY_SIZE (smc91x_resources), + .resource = smc91x_resources, +}; + +static struct platform_device *atari_ethernat_devices[]__initdata = { + &smc91x_device +}; + +int __init atari_platform_init (void ) +{ +int rv =0 ; + +if (!MACH_IS_ATARI ) +return -ENODEV ; + +#ifdef CONFIG_ATARI_ETHERNAT + { +unsigned char *enatc_virt; + enatc_virt = (unsigned char *)ioremap ((ATARI_ETHERNAT_PHYS_ADDR +0x23 ),0xf ); +if (hwreg_present (enatc_virt)) { + rv =platform_add_devices (atari_ethernat_devices, +ARRAY_SIZE (atari_ethernat_devices)); + } +iounmap (enatc_virt); + } +#endif + +return rv; +} + +arch_initcall (atari_platform_init);
arch/m68k/include/asm/atarihw.h +6 -0
@@ -805,5 +805,11 @@ struct MSTE_RTC {#define mste_rtc ((*(volatile struct MSTE_RTC *)MSTE_RTC_BAS)) +/* +** EtherNAT add-on card for Falcon - combined ethernet and USB adapter +*/ + +#define ATARI_ETHERNAT_PHYS_ADDR 0x80000000 +#endif /* linux/atarihw.h */
arch/m68k/include/asm/atariints.h +1 -1
@@ -32,7 +32,7 @@#define VME_SOURCE_BASE 56#define VME_MAX_SOURCES 16 -#define NUM_ATARI_SOURCES (VME_SOURCE_BASE+VME_MAX_SOURCES-STMFP_SOURCE_BASE) +#define NUM_ATARI_SOURCES 141/* convert vector number to int source number */ #define IRQ_VECTOR_TO_SOURCE (v) ((v) - ((v) < 0x20 ? 0x18 : (0x40-8)))
arch/m68k/include/asm/irq.h +5 -1
@@ -6,12 +6,16 @@* different m68k hosts compiled into the kernel. * Currently the Atari has 72 and the Amiga 24, but if both are * supported in the kernel it is better to make room for 72. +* With EtherNAT add-on card on Atari, the highest interrupt +* number is 140 so NR_IRQS needs to be 141. */ #if defined(CONFIG_COLDFIRE )#define NR_IRQS 256#elif defined(CONFIG_VME ) || defined(CONFIG_SUN3 ) || defined(CONFIG_SUN3X )#define NR_IRQS 200 -#elif defined(CONFIG_ATARI ) || defined(CONFIG_MAC ) +#elif defined(CONFIG_ATARI ) +#define NR_IRQS 141 +#elif defined(CONFIG_MAC )#define NR_IRQS 72#elif defined(CONFIG_Q40 )#define NR_IRQS 43
Signature · 1 line
1.7.0.4
PATCH 6/12 m68k/atari: EtherNEC - add platform device support
In reply to Michael SchmitzAdd platform device for the Atari ROM port ethernet adapter, EtherNEC. This platform device will be used by the ne.c driver.
--- arch/m68k/atari/config.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-)
arch/m68k/atari/config.c +50 -0
@@ -694,6 +694,41 @@ static struct platform_device *atari_ethernat_devices[] __initdata = { &smc91x_device }; +/* +* EtherNEC: RTL8019 (NE2000 compatible) Ethernet chipset, +* handled by ne.c driver +*/ + +#define ATARI_ETHERNEC_PHYS_ADDR 0xfffa0000 +#define ATARI_ETHERNEC_BASE 0x300 +#define ATARI_ETHERNEC_IRQ IRQ_MFP_TIMER1 + +static struct resource rtl8019_resources[] = { + [0 ] = { + .name ="rtl8019-regs" , + .start =ATARI_ETHERNEC_BASE , + .end =ATARI_ETHERNEC_BASE +0x20 -1 , + .flags =IORESOURCE_IO , + }, + [1 ] = { + .name ="rtl8019-irq" , + .start =ATARI_ETHERNEC_IRQ , + .end =ATARI_ETHERNEC_IRQ , + .flags =IORESOURCE_IRQ , + }, +}; + +static struct platform_device rtl8019_device = { + .name ="ne" , + .id =-1 , + .num_resources =ARRAY_SIZE (rtl8019_resources), + .resource = rtl8019_resources, +}; + +static struct platform_device *atari_ethernec_devices[]__initdata = { + &rtl8019_device +}; +int __init atari_platform_init (void ) {int rv =0 ;
@@ -713,6 +748,21 @@ int __init atari_platform_init(void) }#endif +#ifdef CONFIG_ATARI_ETHERNEC + { +int error; +unsigned char *enec_virt; + enec_virt = (unsigned char *)ioremap ((ATARI_ETHERNEC_PHYS_ADDR ),0xf ); +if (hwreg_present (enec_virt)) { + error =platform_add_devices (atari_ethernec_devices, +ARRAY_SIZE (atari_ethernec_devices)); +if (error && !rv) + rv = error; + } +iounmap (enec_virt); + } +#endif +return rv; }
Signature · 1 line
1.7.0.4
PATCH 7/12 m68k/atari: EtherNAT - ethernet support - new driver (smc91x)
In reply to Michael SchmitzAdd Atari specific code to the smc91x Ethernet driver. This code is used on the EtherNAT adapter card for the Atari Falcon extension port.
Without the patch to smc91x.h, the first two bytes of every ethernet packet sent out are swapped, resulting in a wrong MAC address being read by the packet's target, and failure to establish communication.
--- arch/m68k/Kconfig.devices | 10 ++++++ drivers/net/ethernet/smsc/Kconfig | 4 +- drivers/net/ethernet/smsc/smc91x.h | 63 ++++++++++++++++++++++++++++++++++- 3 files changed, 73 insertions(+), 4 deletions(-)
arch/m68k/Kconfig.devices +10 -0
@@ -55,6 +55,16 @@ config NFETH which will emulate a regular ethernet device while presenting an ethertap device to the host system. +config ATARI_ETHERNAT + bool "Atari EtherNAT Ethernet support" + depends on ATARI + ---help--- + Say Y to include support for the EtherNAT network adapter for the + CT/60 extension port. + + To compile the actual ethernet driver, choose Y or M for the SMC91X + option in the network device section; the module will be called smc91x. + endmenu menu "Character devices"
drivers/net/ethernet/smsc/Kconfig +2 -2
@@ -6,7 +6,7 @@ config NET_VENDOR_SMSC bool "SMC (SMSC)/Western Digital devices" default y depends on ARM || ISA || MAC || ARM || MIPS || M32R || SUPERH || \ - BLACKFIN || MN10300 || COLDFIRE || PCI || PCMCIA + BLACKFIN || MN10300 || COLDFIRE || PCI || PCMCIA || ATARI ---help--- If you have a network (Ethernet) card belonging to this class, say Y and read the Ethernet-HOWTO, available from
@@ -40,7 +40,7 @@ config SMC91X select NET_CORE select MII depends on (ARM || M32R || SUPERH || MIPS || BLACKFIN || \ - MN10300 || COLDFIRE) + MN10300 || COLDFIRE || ATARI_ETHERNAT) ---help--- This is a driver for SMC's 91x series of Ethernet chipsets, including the SMC91C94 and the SMC91C111. Say Y if you want it
drivers/net/ethernet/smsc/smc91x.h +61 -2
90 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 8/12 m68k/atari: EtherNEC - ethernet support - new driver (ne.c)
In reply to Michael SchmitzSupport for Atari EtherNEC ROM port adapters in ne.c
--- arch/m68k/Kconfig.devices | 14 ++++++++++++++ drivers/net/ethernet/8390/Kconfig | 3 ++- drivers/net/ethernet/8390/ne.c | 2 ++ 3 files changed, 18 insertions(+), 1 deletions(-)
arch/m68k/Kconfig.devices +14 -0
@@ -65,6 +65,20 @@ config ATARI_ETHERNAT To compile the actual ethernet driver, choose Y or M for the SMC91X option in the network device section; the module will be called smc91x. +config ATARI_ETHERNEC + bool "Atari EtherNEC Ethernet support" + depends on ATARI_ROM_ISA + ---help--- + Say Y to include support for the EtherNEC network adapter for the + ROM port. The driver works by polling instead of interrupts, so it + is quite slow. + + This driver also suppports the ethernet part of the NetUSBee ROM + port combined Ethernet/USB adapter. + + To compile the actual ethernet driver, choose Y or M in for the NE2000 + option in the network device section; the module will be called ne. + endmenu menu "Character devices"
drivers/net/ethernet/8390/Kconfig +2 -1
@@ -91,7 +91,8 @@ config MCF8390 config NE2000 tristate "NE2000/NE1000 support" - depends on (ISA || (Q40 && m) || M32R || MACH_TX49XX) + depends on (ISA || (Q40 && m) || M32R || MACH_TX49XX || \ + ATARI_ETHERNEC) select CRC32 ---help--- If you have a network (Ethernet) card of this type, say Y and read
drivers/net/ethernet/8390/ne.c +2 -0
@@ -166,6 +166,8 @@ bad_clone_list[] __initdata = {#elif defined(CONFIG_PLAT_OAKS32R ) || \ defined(CONFIG_MACH_TX49XX )# define DCR_VAL 0x48/* 8-bit mode */ +#elif defined(CONFIG_ATARI )/* 8-bit mode on Atari, normal on Q40 */ +# define DCR_VAL (MACH_IS_ATARI ? 0x48 : 0x49)#else # define DCR_VAL 0x49#endif
Signature · 1 line
1.7.0.4
PATCH 9/12 m68k/atari: EtherNAT - add interrupt chip definition for CPLD interrupts
In reply to Michael SchmitzAdd a dedicated interrupt chip definition for the EtherNAT CPLD interrupts. SMC91C111 and ISP1160 chips have separate interrupts that can be enabled and disabled in a CPLD register at offset 0x23 from the card base.
Note the CPLD interrupt control register is mapped on demand, whenever any interrupt enable/disable action is requested. The EtherNAT USB driver still needs interrupts disabled around reset and start actions.
In particular, we cannot entirely rely on the irq_startup being called first.
The smc91x and isp116x-hcd drivers will use this feature.
--- arch/m68k/atari/ataints.c | 81 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 81 insertions(+), 0 deletions(-)
arch/m68k/atari/ataints.c +81 -0
@@ -49,6 +49,7 @@#include <asm/atari_stdma.h> #include <asm/irq.h> #include <asm/entry.h> +#include <asm/io.h> /*
@@ -177,6 +178,79 @@ static struct irq_chip atari_mfptimer_chip = { .irq_disable = atari_mfptimer_disable, }; + +/* +* EtherNAT CPLD interrupt handling +* CPLD interrupt register is at phys. 0x80000023 +* Need this mapped in at interrupt startup time +* Possibly need this mapped on demand anyway - +* EtherNAT USB driver needs to disable IRQ before +* startup! +*/ + +static unsigned char *enat_cpld; + +static unsigned int atari_ethernat_startup (struct irq_data *data) +{ +int enat_num =140 - data->irq +1 ; + +m68k_irq_startup (data); +/* +* map CPLD interrupt register +*/ +if (!enat_cpld) + enat_cpld = (unsigned char *)ioremap ((ATARI_ETHERNAT_PHYS_ADDR +0x23 ),0x2 ); +/* +* do _not_ enable the USB chip interrupt here - causes interrupt storm +* and triggers dead interrupt watchdog +* Need to reset the USB chip to a sane state in early startup before removing this hack +*/ +if (enat_num ==1 ) + *enat_cpld |=1 << enat_num; + +return 0 ; +} + +static void atari_ethernat_enable (struct irq_data *data) +{ +int enat_num =140 - data->irq +1 ; +/* +* map CPLD interrupt register +*/ +if (!enat_cpld) + enat_cpld = (unsigned char *)ioremap ((ATARI_ETHERNAT_PHYS_ADDR +0x23 ),0x2 ); + *enat_cpld |=1 << enat_num; +} + +static void atari_ethernat_disable (struct irq_data *data) +{ +int enat_num =140 - data->irq +1 ; +/* +* map CPLD interrupt register +*/ +if (!enat_cpld) + enat_cpld = (unsigned char *)ioremap ((ATARI_ETHERNAT_PHYS_ADDR +0x23 ),0x2 ); + *enat_cpld &= ~(1 << enat_num); +} + +static void atari_ethernat_shutdown (struct irq_data *data) +{ +int enat_num =140 - data->irq +1 ; +if (enat_cpld) { + *enat_cpld &= ~(1 << enat_num); +iounmap (enat_cpld); + enat_cpld =NULL ; + } +} + +static struct irq_chip atari_ethernat_chip = { + .name ="ethernat" , + .irq_startup = atari_ethernat_startup, + .irq_shutdown = atari_ethernat_shutdown, + .irq_enable = atari_ethernat_enable, + .irq_disable = atari_ethernat_disable, +}; +/* * void atari_init_IRQ (void) *
@@ -268,6 +342,13 @@ void __init atari_init_IRQ(void)if (request_irq (IRQ_MFP_TIMD , mfptimer_handler,IRQF_SHARED , stmfp_base.name, &stmfp_base))pr_err ("Couldn't register %s interrupt\n" , stmfp_base.name); + +/* +* EtherNAT ethernet / USB interrupt handlers +*/ + +m68k_setup_irq_controller (&atari_ethernat_chip, handle_simple_irq, +139 ,2 ); }
Signature · 1 line
1.7.0.4
PATCH 10/12 m68k: Implement ndelay() based on the existing udelay() logic
In reply to Michael SchmitzAdd a ndelay macro modeled after the Coldfire udelay(). The ISP1160 driver needs a 150ns delay, so we need to have ndelay().
--- arch/m68k/include/asm/delay.h | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-)
arch/m68k/include/asm/delay.h +20 -0
@@ -92,5 +92,25 @@ static inline void __udelay(unsigned long usecs)#define udelay (n) (__builtin_constant_p(n) ? \ ((n) > 20000 ? __bad_udelay() : __const_udelay(n)) : __udelay(n)) +/* +* nanosecond delay: +* +* ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) is the number of loops per microsecond +* +* 1000 / ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) is the number of nanoseconds per loop +* +* So n / ( 1000 / ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6) ) would be the number of loops for n nanoseconds +*/ + +/* +* The simpler m68k and ColdFire processors do not have a 32*32->64 +* multiply instruction. So we need to handle them a little differently. +* We use a bit of shifting and a single 32*32->32 multiply to get close. +* This is a macro so that the const version can factor out the first +* multiply and shift. +*/ +#define HZSCALE (268435456 / (1000000 / HZ)) + +#define ndelay (n) __delay(DIV_ROUND_UP((n) * ((((HZSCALE) >> 11) * (loops_per_jiffy >> 11)) >> 6), 1000));#endif /* defined(_M68K_DELAY_H) */
Signature · 1 line
1.7.0.4
PATCH 11/12 m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCD
In reply to Michael SchmitzAdd platform devices used by the isp116x-hcd driver for EtherNAT and NetUSBee. Note that the NetUSBee also contains a RTL8019 Ethernet chip, so its platform device is used to cover the EtherNEC case, too. Register definitions thanks to David Galvez <[email protected]>
--- arch/m68k/atari/config.c | 131 ++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 126 insertions(+), 5 deletions(-)
arch/m68k/atari/config.c +126 -5
@@ -32,6 +32,7 @@#include <linux/delay.h> #include <linux/ioport.h> #include <linux/platform_device.h> +#include <linux/usb/isp116x.h> #include <linux/vt_kern.h> #include <linux/module.h>
@@ -690,8 +691,70 @@ static struct platform_device smc91x_device = { .resource = smc91x_resources, }; +/* +* ISP 1160 - using the isp116x-hcd module +*/ + +#define ATARI_USB_PHYS_ADDR 0x80000012 +#define ATARI_USB_IRQ 139 + +static struct resource isp1160_resources[] = { + [0 ] = { + .name ="isp1160-data" , + .start =ATARI_USB_PHYS_ADDR , + .end =ATARI_USB_PHYS_ADDR +0x1 , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .name ="isp1160-regs" , + .start =ATARI_USB_PHYS_ADDR +0x4 , + .end =ATARI_USB_PHYS_ADDR +0x5 , + .flags =IORESOURCE_MEM , + }, + [2 ] = { + .name ="isp1160-irq" , + .start =ATARI_USB_IRQ , + .end =ATARI_USB_IRQ , + .flags =IORESOURCE_IRQ , + }, +}; + +static void isp1160_delay (struct device *dev,int delay) +{ +ndelay (delay); +} + +/* (DataBusWidth16|AnalogOCEnable|DREQOutputPolarity|DownstreamPort15KRSel ) */ +static struct isp116x_platform_data isp1160_platform_data = { +/* Enable internal resistors on downstream ports */ + .sel15Kres =1 , +/* On-chip overcurrent protection */ + .oc_enable =1 , +/* INT output polarity */ + .int_act_high =1 , +/* INT edge or level triggered */ + .int_edge_triggered =0 , + +/* WAKEUP pin connected - NOT SUPPORTED */ +/* .remote_wakeup_connected = 0, */ +/* Wakeup by devices on usb bus enabled */ + .remote_wakeup_enable =0 , + .delay = isp1160_delay, +}; + +static struct platform_device isp1160_device = { + .name ="isp116x-hcd" , + .id =0 , + .num_resources =ARRAY_SIZE (isp1160_resources), + .resource = isp1160_resources, + .dev = { + .platform_data = &isp1160_platform_data, + }, +}; +static struct platform_device *atari_ethernat_devices[]__initdata = { - &smc91x_device + &smc91x_device, + &isp1160_device };/*
@@ -725,8 +788,66 @@ static struct platform_device rtl8019_device = { .resource = rtl8019_resources, }; -static struct platform_device *atari_ethernec_devices[]__initdata = { - &rtl8019_device +/* +* NetUSBee: ISP1160 USB host adapter via ROM-port adapter +*/ + +#define ATARI_NETUSBEE_PHYS_ADDR 0xfffa8000 +#define ATARI_NETUSBEE_BASE 0x340 +#define ATARI_NETUSBEE_IRQ IRQ_MFP_TIMER2 + +static struct resource netusbee_resources[] = { + [0 ] = { + .name ="isp1160-data" , + .start =ATARI_NETUSBEE_BASE , + .end =ATARI_NETUSBEE_BASE +0x1 , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .name ="isp1160-regs" , + .start =ATARI_NETUSBEE_BASE +0x20 , + .end =ATARI_NETUSBEE_BASE +0x21 , + .flags =IORESOURCE_MEM , + }, + [2 ] = { + .name ="isp1160-irq" , + .start =ATARI_NETUSBEE_IRQ , + .end =ATARI_NETUSBEE_IRQ , + .flags =IORESOURCE_IRQ , + }, +}; + +/* (DataBusWidth16|AnalogOCEnable|DREQOutputPolarity|DownstreamPort15KRSel ) */ +static struct isp116x_platform_data netusbee_platform_data = { +/* Enable internal resistors on downstream ports */ + .sel15Kres =1 , +/* On-chip overcurrent protection */ + .oc_enable =1 , +/* INT output polarity */ + .int_act_high =1 , +/* INT edge or level triggered */ + .int_edge_triggered =0 , + +/* WAKEUP pin connected - NOT SUPPORTED */ +/* .remote_wakeup_connected = 0, */ +/* Wakeup by devices on usb bus enabled */ + .remote_wakeup_enable =0 , + .delay = isp1160_delay, +}; + +static struct platform_device netusbee_device = { + .name ="isp116x-hcd" , + .id =1 , + .num_resources =ARRAY_SIZE (netusbee_resources), + .resource = netusbee_resources, + .dev = { + .platform_data = &netusbee_platform_data, + }, +}; + +static struct platform_device *atari_netusbee_devices[]__initdata = { + &rtl8019_device, + &netusbee_device };int __init atari_platform_init (void )
@@ -754,8 +875,8 @@ int __init atari_platform_init(void)unsigned char *enec_virt; enec_virt = (unsigned char *)ioremap ((ATARI_ETHERNEC_PHYS_ADDR ),0xf );if (hwreg_present (enec_virt)) { - error =platform_add_devices (atari_ethernec_devices, -ARRAY_SIZE (atari_ethernec_devices)); + error =platform_add_devices (atari_netusbee_devices, +ARRAY_SIZE (atari_netusbee_devices));if (error && !rv) rv = error; }
Signature · 1 line
1.7.0.4
Geert Uytterhoeven
maintainerRe: [PATCH 11/12] m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCD
Hi Michael,
arch/m68k/atari/config.c static struct platform_device smc91x_device = { · line 706
Quoted 9 lines · Michael Schmitz
arch/m68k/atari/config.c +6
-0+static struct resource isp1160_resources[] = { + [0 ] = { + .name ="isp1160-data" , + .start =ATARI_USB_PHYS_ADDR , + .end =ATARI_USB_PHYS_ADDR +0x1 , + .flags =IORESOURCE_MEM ,
Shouldn't this be IORESOURCE_IO?
arch/m68k/atari/config.c static struct platform_device smc91x_device = { · line 712
Quoted 6 lines
arch/m68k/atari/config.c +6
-0+ }, + [1] = { + .name = "isp1160-regs", + .start = ATARI_USB_PHYS_ADDR + 0x4, + .end = ATARI_USB_PHYS_ADDR + 0x5, + .flags = IORESOURCE_MEM,
Ditto.
Quoted 1 line
+ },
I have in /proc/iomem:
00000340-00000341 : isp1160-data
00000360-00000361 : isp1160-regs
00684000-00783fff : ST-RAM Pool
00684000-006cffff : atafb
006d0000-006d3fff : ataflop
006d4000-006d4fff : SCSI
fff00000-fff0003f : falconide
and in /proc/ioports:
00000300-0000031f : rtl8019-regs
Sorry for not noticing before.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 11/12] m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCD
Hello Geert,
I believe the ISP116x driver checks for IORESOURCE_MEM resources explicitly, that is why they are defined that way. I may have that wrong or confuse this with the EtherNAT ethernet driver though.
The 0x3xx address is for the NetUSBee case - the EtherNAT USB will be in the 0x80000xx ballpark, does that matter with IO resources?
Cheers,
Michael
Quoted 52 lines · Geert Uytterhoeven
Hi Michael,
arch/m68k/atari/config.c static struct platform_device smc91x_device = { · line 706
Quoted 9 lines · Michael Schmitz
arch/m68k/atari/config.c +6
-0+static struct resource isp1160_resources[] = { + [0 ] = { + .name ="isp1160-data" , + .start =ATARI_USB_PHYS_ADDR , + .end =ATARI_USB_PHYS_ADDR +0x1 , + .flags =IORESOURCE_MEM ,Shouldn't this be
IORESOURCE_IO?arch/m68k/atari/config.c static struct platform_device smc91x_device = { · line 712
Quoted 6 lines
arch/m68k/atari/config.c +6
-0+ }, + [1] = { + .name = "isp1160-regs", + .start = ATARI_USB_PHYS_ADDR + 0x4, + .end = ATARI_USB_PHYS_ADDR + 0x5, + .flags = IORESOURCE_MEM,Ditto.
Quoted 1 line
+ },
I have in
/proc/iomem:00000340-00000341 : isp1160-data
00000360-00000361 : isp1160-regs
00684000-00783fff : ST-RAM Pool
00684000-006cffff : atafb
006d0000-006d3fff : ataflop
006d4000-006d4fff : SCSI
fff00000-fff0003f : falconideand in
/proc/ioports:00000300-0000031f : rtl8019-regs
Sorry for not noticing before.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Geert Uytterhoeven
maintainerRe: [PATCH 11/12] m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCD
Quoted 38 lines · Michael Schmitz
Quoted 36 lines · Geert Uytterhoeven
arch/m68k/atari/config.c static struct platform_device smc91x_device = { · line 706
Quoted 9 lines · Michael Schmitz
arch/m68k/atari/config.c +6
-0+static struct resource isp1160_resources[] = { + [0 ] = { + .name ="isp1160-data" , + .start =ATARI_USB_PHYS_ADDR , + .end =ATARI_USB_PHYS_ADDR +0x1 , + .flags =IORESOURCE_MEM ,Shouldn't this be
IORESOURCE_IO?arch/m68k/atari/config.c static struct platform_device smc91x_device = { · line 712
Quoted 6 lines
arch/m68k/atari/config.c +6
-0+ }, + [1] = { + .name = "isp1160-regs", + .start = ATARI_USB_PHYS_ADDR + 0x4, + .end = ATARI_USB_PHYS_ADDR + 0x5, + .flags = IORESOURCE_MEM,Ditto.
Quoted 1 line
+ },
I have in
/proc/iomem:00000340-00000341 : isp1160-data
00000360-00000361 : isp1160-regs
00684000-00783fff : ST-RAM Pool
00684000-006cffff : atafb
006d0000-006d3fff : ataflop
006d4000-006d4fff : SCSI
fff00000-fff0003f : falconideand in
/proc/ioports:
Quoted 8 lines
Quoted 1 line
00000300-0000031f : rtl8019-regs
I believe the ISP116x driver checks for
IORESOURCE_MEMresources explicitly, that is why they are defined that way. I may have that wrong or confuse this with the EtherNAT ethernet driver though.The 0x3xx address is for the NetUSBee case - the EtherNAT USB will be in the 0x80000xx ballpark, does that matter with IO resources?
As the ISA I/O ports are memory mapped on m68k anyway, it doesn't matter that much, and will just work. But semantically the I/O region is part of I/O space, not memory space.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 11/12] m68k/atari: USB - add platform devices for EtherNAT/NetUSBee ISP1160 HCD
Hi Geert,
Quoted 10 lines
Quoted 6 lines
I believe the ISP116x driver checks for
IORESOURCE_MEMresources explicitly, that is why they are defined that way. I may have that wrong or confuse this with the EtherNAT ethernet driver though.The 0x3xx address is for the NetUSBee case - the EtherNAT USB will be in the 0x80000xx ballpark, does that matter with IO resources?
As the ISA I/O ports are memory mapped on m68k anyway, it doesn't matter that much, and will just work. But semantically the I/O region is part of I/O space, not memory space.
Fine, no objections to changing it then. I'll test that once I return, but I trust your judgemebt there - it's cleaner, so let's fix it.
Cheers,
Michael
Quoted 62 lines · Geert Uytterhoeven
Quoted 38 lines · Michael Schmitz
Quoted 36 lines · Geert Uytterhoeven
arch/m68k/atari/config.c static struct platform_device smc91x_device = { · line 706
Quoted 9 lines · Michael Schmitz
arch/m68k/atari/config.c +6
-0+static struct resource isp1160_resources[] = { + [0 ] = { + .name ="isp1160-data" , + .start =ATARI_USB_PHYS_ADDR , + .end =ATARI_USB_PHYS_ADDR +0x1 , + .flags =IORESOURCE_MEM ,Shouldn't this be
IORESOURCE_IO?arch/m68k/atari/config.c static struct platform_device smc91x_device = { · line 712
Quoted 6 lines
arch/m68k/atari/config.c +6
-0+ }, + [1] = { + .name = "isp1160-regs", + .start = ATARI_USB_PHYS_ADDR + 0x4, + .end = ATARI_USB_PHYS_ADDR + 0x5, + .flags = IORESOURCE_MEM,Ditto.
Quoted 1 line
+ },
I have in
/proc/iomem:00000340-00000341 : isp1160-data
00000360-00000361 : isp1160-regs
00684000-00783fff : ST-RAM Pool
00684000-006cffff : atafb
006d0000-006d3fff : ataflop
006d4000-006d4fff : SCSI
fff00000-fff0003f : falconideand in
/proc/ioports:Quoted 8 lines
Quoted 1 line
00000300-0000031f : rtl8019-regs
I believe the ISP116x driver checks for
IORESOURCE_MEMresources explicitly, that is why they are defined that way. I may have that wrong or confuse this with the EtherNAT ethernet driver though.The 0x3xx address is for the NetUSBee case - the EtherNAT USB will be in the 0x80000xx ballpark, does that matter with IO resources?
As the ISA I/O ports are memory mapped on m68k anyway, it doesn't matter that much, and will just work. But semantically the I/O region is part of I/O space, not memory space.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
PATCH 12/12 m68k/atari: USB - add ISP1160 USB host controller support
In reply to Michael SchmitzAdd Atari specific quirks to the isp116x-hcd USB driver used for EtherNAT and NetUSBee. The bus interface of both devices is byte swapped in hardware, this has to be taken into account by the register access macros. On the EtherNAT, interrupts have to be explicitly disabled and enabled around reset and start callbacks.
Debugging of FIFO register access code and NetUSBee support by David Galvez <[email protected]> (MiNT driver author)
--- arch/m68k/Kconfig.bus | 11 ++++++ drivers/usb/host/isp116x-hcd.c | 69 +++++++++++++++++++++++++++++++++++++++- drivers/usb/host/isp116x.h | 41 ++++++++++++++++++----- 3 files changed, 111 insertions(+), 10 deletions(-)
arch/m68k/Kconfig.bus +11 -0
@@ -55,6 +55,17 @@ config ATARI_ROM_ISA The only driver currently using this adapter is the EtherNEC driver for RTL8019AS based NE2000 compatible network cards. +config ATARI_USB + bool "Atari USB host controller support" + depends on ATARI + select USB_SUPPORT + select USB_ARCH_HAS_HCD + help + This option enables support for USB host controllers contained on + the EtherNAT and NetUSBee cards for Atari. You will have to select + an appropriate HCD driver in the USB section (the ISP1160 one is + the most commonly used one). + config GENERIC_ISA_DMA def_bool ISA
drivers/usb/host/isp116x-hcd.c +68 -1
167 lines not on this page · raw message
drivers/usb/host/isp116x.h +32 -9
86 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Geert Uytterhoeven
maintainerHi Michael,
Quoted 8 lines · Michael Schmitz
here's my rewrite of the Atari patch series for upstream submission - the only changes are to patches 9 and 12.
The USB patch no longer disables the chip interrupt in the interrupt handler - it turns out this wasn't necessary at all. It also does away with direct writes to the EtherNAT interrupt control register, and uses
enable_irq()anddisable_irq()instead. The probe code has become a lot cleaner as a result.
Thanks, I applied all of them, with some minor changes:
- Changed one instance of ATARI to ATARI_ETHERNAT in drivers/net/ethernet/smsc/Kconfig, for consistency,
- Split too long comments,
- Made platform device structures and isp1160_delay() in arch/m68k/atari/config.c depend on the appropriate CONFIG_* symbols, else you get unused warnings from the compiler if CONFIG_ETHERNAT and/or CONFIG_ETHERNEC are not set.
I also updated your old series for the m68k master branch to the latest corresponding
version for upstream, so master == m68k-queue.
Please send the patches for drivers/net and drivers/usb to the net resp. usb mailing lists, to collects acks and comments.
Thanks again!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Hi Geert,
trying again as plain text ...
Quoted 11 lines · Michael Schmitz
Quoted 8 lines
here's my rewrite of the Atari patch series for upstream submission - the only changes are to patches 9 and 12.
The USB patch no longer disables the chip interrupt in the interrupt handler - it turns out this wasn't necessary at all. It also does away with direct writes to the EtherNAT interrupt control register, and uses
enable_irq()anddisable_irq()instead. The probe code has become a lot cleaner as a result.
Quoted 9 lines
Thanks, I applied all of them, with some minor changes:
- Changed one instance of ATARI toATARI_ETHERNATindrivers/net/ethernet/smsc/Kconfig, for consistency,
- Split too long comments,
- Made platform device structures andisp1160_delay()inarch/m68k/atari/config.cdepend on the appropriate CONFIG_* symbols, else you get unused warnings from the compiler ifCONFIG_ETHERNATand/orCONFIG_ETHERNECare not set.
Thanks, that's perfect!
Quoted 5 lines
I also updated your old series for the m68k master branch to the latest corresponding
version for upstream, so master == m68k-queue.
Much appreciated! I'll look forward to pulling this back and
resolving the differences now.
Quoted 2 lines
Please send the patches for
drivers/netanddrivers/usbto the net resp. usb mailing lists, to collects acks and comments.
Will do that ASAP!
Thanks,
Michael
Quoted 40 lines · Geert Uytterhoeven
Hi Michael,
Quoted 8 lines · Michael Schmitz
here's my rewrite of the Atari patch series for upstream submission - the only changes are to patches 9 and 12.
The USB patch no longer disables the chip interrupt in the interrupt handler - it turns out this wasn't necessary at all. It also does away with direct writes to the EtherNAT interrupt control register, and uses
enable_irq()anddisable_irq()instead. The probe code has become a lot cleaner as a result.Thanks, I applied all of them, with some minor changes:
- Changed one instance of ATARI toATARI_ETHERNATindrivers/net/ethernet/smsc/Kconfig, for consistency,
- Split too long comments,
- Made platform device structures andisp1160_delay()inarch/m68k/atari/config.cdepend on the appropriate CONFIG_* symbols, else you get unused warnings from the compiler ifCONFIG_ETHERNATand/orCONFIG_ETHERNECare not set.I also updated your old series for the m68k master branch to the latest corresponding
version for upstream, so master == m68k-queue.Please send the patches for
drivers/netanddrivers/usbto the net resp. usb mailing lists, to collects acks and comments.Thanks again!
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Geert Uytterhoeven
maintainerHi Michael,
Quoted 10 lines · Geert Uytterhoeven
Quoted 8 lines · Michael Schmitz
here's my rewrite of the Atari patch series for upstream submission - the only changes are to patches 9 and 12.
The USB patch no longer disables the chip interrupt in the interrupt handler - it turns out this wasn't necessary at all. It also does away with direct writes to the EtherNAT interrupt control register, and uses
enable_irq()anddisable_irq()instead. The probe code has become a lot cleaner as a result.
Quoted 6 lines
Thanks, I applied all of them, with some minor changes:
- Made platform device structures and
isp1160_delay()inarch/m68k/atari/config.cdepend on the appropriate CONFIG_* symbols, else you get unused warnings from the compiler ifCONFIG_ETHERNATand/orCONFIG_ETHERNECare not set.
I moved the introduction of CONFIG_ETHERNAT and CONFIG_ETHERNEC into the commits that added the corresponding platform devices, so they became independent of the commits that update files under drivers/net/. I also queued all arch/m68k commits to for-3.10/for-next.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Hi Geert,
Quoted 10 lines
Quoted 5 lines
- Made platform device structures and
isp1160_delay()inarch/m68k/atari/config.cdepend on the appropriate CONFIG_* symbols, else you get unused warnings from the compiler ifCONFIG_ETHERNATand/orCONFIG_ETHERNECare not set.I moved the introduction of
CONFIG_ETHERNATandCONFIG_ETHERNECinto the commits that added the corresponding platform devices, so they became independent of the commits that update files underdrivers/net/.
Thanks - I'll have a look at what that involves. Sounds reasonable.
Quoted 3 lines
I also queued all
arch/m68kcommits to for-3.10/for-next.
Hint, hint ... I still haven't submitted net and USB stuff for comments :-(
We have ANZAC day coming up next week - should give me enough time unless sorted before.
Cheers,
Michael
Geert Uytterhoeven
maintainerHi Michael,
Quoted 9 lines · Michael Schmitz
Quoted 3 lines
I moved the introduction of
CONFIG_ETHERNATandCONFIG_ETHERNECinto the commits that added the corresponding platform devices, so they became independent of the commits that update files underdrivers/net/.Thanks - I'll have a look at what that involves. Sounds reasonable.
Quoted 1 line
I also queued all
arch/m68kcommits to for-3.10/for-next.Hint, hint ... I still haven't submitted net and USB stuff for comments :-(
I know. That's why I moved the Kconfig changes, so I can get the m68k-specific parts
in without depending on the net/usb changes, as I expect the merge window to open next weekend.
Quoted 2 lines
We have ANZAC day coming up next week - should give me enough time unless sorted before.
Enjoy the holiday ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAMuHMdU-Za_VqW4x9fJwDD4-VD=+DLaSNQNY6YrHibQq+GyC_A@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAMuHMdVCfM8c=Aj-cgHMDLavFvbxcHAyHrh930S4ncV-6uDW_g@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAMuHMdVJWU5uJB9iNRvOmXDV1C5C1dnCiEDPx4yG5n1C4hqtzQ@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): CAMuHMdUkNUzF_Cr5xS+i7hFbW-wuxZYTa8Gh3wH2pyXVxDTouQ@mail.gmail.com
Hi Geert,
[taking this back to the list ...]
Quoted 5 lines
Before rebasing, you can also use "git cherry -v" to list the commits. Git will prepend
them with "+" if it's new, "-" if it's already present. Note that git may guess wrong if the
commits have changed/cause conflicts.
Thanks, that does help!
Quoted 8 lines
E.g. the next command show me what's in my m68k-queue, and not yet in for-linus (the third parameter "v3.9" is there to limit displaying to commits not yet in v3.9.
As "for-linus" is based on v3.9-rc7, it would also list all commits
between v3.9-rc7 and
v3.9 if I omit the "v3.9" parameter):$ git cherry -v for-linus m68k-queue v3.9
Nice trick - I tried git cherry but the output on two branches one merged and one unmerged was too confusing.
Quoted 4 lines
Quoted 2 lines
That was the 3.9-rc2 version of m68k-queue, after git fetch and git rebase origin/m68k-queue.
OK, that one didn't have the new version yet.
Come to think of it - I am quite sure the branch _should_ have been based on -rc7 because I updated to that not too long ago.
Quoted 5 lines
Quoted 3 lines
Is this because m68k-queue was rebased in your tree (from 3.9-rc2 to 3.9), perhaps?
Anyway, I won't do that in a hurr again :-)Yes, I rebase m68k-queue on every -rc release.
OK, I'll just have to deal with that. Not sure what my next project will be
- the Amiga SCSI still simmers away on the back burner.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
If you want to retry, try to rebase on top of m68k-v3.9 (= version of m68k-queue on top of v3.9).
I'd have to reset to the old HEAD of my m68k-queue working tree before rebasing to m68k-v3.9, correct?
Indeed. But if the differences are small, just cherry-pick your new commits. Or manually remove the old ones when using "rebase -i".
Cherry picking sure looks easier...
Another question: Is there a way to find out which physical address maps to a given ioremapped one?
If I let the USB driver print the physical address, the ioremapped address, and the result of __pa() on the ioremapped one, I get:
ISP116X probe: data 80000012 virt. 21098012 pa 21098012 , addr 80000016 virt. 21096016 pa 21096016
for the EtherNAT instance, and
ISP116X probe: data 00000340 virt. 2109e340 pa 2109e340 , addr 00000360 virt. 2109c360 pa 2109c360
for the NetUSBee instance. In both cases ioremapped and __pa() are equal.
I had hoped to get the physical address back from __pa() in the first instance, and check for _pa(reg) > 0x8000000 to differentiate between the two instances. Not so simple, apparently.
Any idea? Anyone?
Cheers,
Michael
Geert Uytterhoeven
maintainerQuoted 11 lines · Michael Schmitz
Another question: Is there a way to find out which physical address maps to a given ioremapped one?
If I let the USB driver print the physical address, the ioremapped address, and the result of
__pa()on the ioremapped one, I get:ISP116X probe: data 80000012 virt. 21098012 pa 21098012 , addr 80000016 virt. 21096016 pa 21096016
for the EtherNAT instance, and
Quoted 8 lines
ISP116X probe: data 00000340 virt.
2109e340pa2109e340, addr 00000360 virt.2109c360pa2109c360for the NetUSBee instance. In both cases ioremapped and
__pa()are equal.I had hoped to get the physical address back from
__pa()in the first instance, and check for_pa(reg)>0x8000000to differentiate between the two instances. Not so simple, apparently.
__pa() (and virt_to_phys()) only work for system RAM, where the mapping is just the addition of an offset.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds