Loading Documentation/spi/butterfly +17 −6 Original line number Diff line number Diff line Loading @@ -12,13 +12,20 @@ You can make this adapter from an old printer cable and solder things directly to the Butterfly. Or (if you have the parts and skills) you can come up with something fancier, providing ciruit protection to the Butterfly and the printer port, or with a better power supply than two signal pins from the printer port. signal pins from the printer port. Or for that matter, you can use similar cables to talk to many AVR boards, even a breadboard. This is more powerful than "ISP programming" cables since it lets kernel SPI protocol drivers interact with the AVR, and could even let the AVR issue interrupts to them. Later, your protocol driver should work easily with a "real SPI controller", instead of this bitbanger. The first cable connections will hook Linux up to one SPI bus, with the AVR and a DataFlash chip; and to the AVR reset line. This is all you need to reflash the firmware, and the pins are the standard Atmel "ISP" connector pins (used also on non-Butterfly AVR boards). connector pins (used also on non-Butterfly AVR boards). On the parport side this is like "sp12" programming cables. Signal Butterfly Parport (DB-25) ------ --------- --------------- Loading @@ -40,10 +47,14 @@ by clearing PORTB.[0-3]); (b) configure the mtd_dataflash driver; and SELECT = J400.PB0/nSS = pin 17/C3,nSELECT GND = J400.GND = pin 24/GND The "USI" controller, using J405, can be used for a second SPI bus. That would let you talk to the AVR over SPI, running firmware that makes it act as an SPI slave, while letting either Linux or the AVR use the DataFlash. There are plenty of spare parport pins to wire this one up, such as: Or you could flash firmware making the AVR into an SPI slave (keeping the DataFlash in reset) and tweak the spi_butterfly driver to make it bind to the driver for your custom SPI-based protocol. The "USI" controller, using J405, can also be used for a second SPI bus. That would let you talk to the AVR using custom SPI-with-USI firmware, while letting either Linux or the AVR use the DataFlash. There are plenty of spare parport pins to wire this one up, such as: Signal Butterfly Parport (DB-25) ------ --------- --------------- Loading drivers/base/base.h +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,10 @@ extern void bus_remove_driver(struct device_driver *); extern void driver_detach(struct device_driver * drv); extern int driver_probe_device(struct device_driver *, struct device *); extern void sysdev_shutdown(void); extern int sysdev_suspend(pm_message_t state); extern int sysdev_resume(void); static inline struct class_device *to_class_dev(struct kobject *obj) { return container_of(obj, struct class_device, kobj); Loading drivers/base/power/resume.c +1 −2 Original line number Diff line number Diff line Loading @@ -9,10 +9,9 @@ */ #include <linux/device.h> #include "../base.h" #include "power.h" extern int sysdev_resume(void); /** * resume_device - Restore state for one device. Loading drivers/base/power/shutdown.c +1 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ #include <linux/device.h> #include <asm/semaphore.h> #include "../base.h" #include "power.h" #define to_dev(node) container_of(node, struct device, kobj.entry) Loading @@ -28,7 +29,6 @@ extern struct subsystem devices_subsys; * they only get one called once when interrupts are disabled. */ extern int sysdev_shutdown(void); /** * device_shutdown - call ->shutdown() on each device to shutdown. Loading drivers/base/power/suspend.c +1 −2 Original line number Diff line number Diff line Loading @@ -9,10 +9,9 @@ */ #include <linux/device.h> #include "../base.h" #include "power.h" extern int sysdev_suspend(pm_message_t state); /* * The entries in the dpm_active list are in a depth first order, simply * because children are guaranteed to be discovered after parents, and Loading Loading
Documentation/spi/butterfly +17 −6 Original line number Diff line number Diff line Loading @@ -12,13 +12,20 @@ You can make this adapter from an old printer cable and solder things directly to the Butterfly. Or (if you have the parts and skills) you can come up with something fancier, providing ciruit protection to the Butterfly and the printer port, or with a better power supply than two signal pins from the printer port. signal pins from the printer port. Or for that matter, you can use similar cables to talk to many AVR boards, even a breadboard. This is more powerful than "ISP programming" cables since it lets kernel SPI protocol drivers interact with the AVR, and could even let the AVR issue interrupts to them. Later, your protocol driver should work easily with a "real SPI controller", instead of this bitbanger. The first cable connections will hook Linux up to one SPI bus, with the AVR and a DataFlash chip; and to the AVR reset line. This is all you need to reflash the firmware, and the pins are the standard Atmel "ISP" connector pins (used also on non-Butterfly AVR boards). connector pins (used also on non-Butterfly AVR boards). On the parport side this is like "sp12" programming cables. Signal Butterfly Parport (DB-25) ------ --------- --------------- Loading @@ -40,10 +47,14 @@ by clearing PORTB.[0-3]); (b) configure the mtd_dataflash driver; and SELECT = J400.PB0/nSS = pin 17/C3,nSELECT GND = J400.GND = pin 24/GND The "USI" controller, using J405, can be used for a second SPI bus. That would let you talk to the AVR over SPI, running firmware that makes it act as an SPI slave, while letting either Linux or the AVR use the DataFlash. There are plenty of spare parport pins to wire this one up, such as: Or you could flash firmware making the AVR into an SPI slave (keeping the DataFlash in reset) and tweak the spi_butterfly driver to make it bind to the driver for your custom SPI-based protocol. The "USI" controller, using J405, can also be used for a second SPI bus. That would let you talk to the AVR using custom SPI-with-USI firmware, while letting either Linux or the AVR use the DataFlash. There are plenty of spare parport pins to wire this one up, such as: Signal Butterfly Parport (DB-25) ------ --------- --------------- Loading
drivers/base/base.h +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,10 @@ extern void bus_remove_driver(struct device_driver *); extern void driver_detach(struct device_driver * drv); extern int driver_probe_device(struct device_driver *, struct device *); extern void sysdev_shutdown(void); extern int sysdev_suspend(pm_message_t state); extern int sysdev_resume(void); static inline struct class_device *to_class_dev(struct kobject *obj) { return container_of(obj, struct class_device, kobj); Loading
drivers/base/power/resume.c +1 −2 Original line number Diff line number Diff line Loading @@ -9,10 +9,9 @@ */ #include <linux/device.h> #include "../base.h" #include "power.h" extern int sysdev_resume(void); /** * resume_device - Restore state for one device. Loading
drivers/base/power/shutdown.c +1 −1 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ #include <linux/device.h> #include <asm/semaphore.h> #include "../base.h" #include "power.h" #define to_dev(node) container_of(node, struct device, kobj.entry) Loading @@ -28,7 +29,6 @@ extern struct subsystem devices_subsys; * they only get one called once when interrupts are disabled. */ extern int sysdev_shutdown(void); /** * device_shutdown - call ->shutdown() on each device to shutdown. Loading
drivers/base/power/suspend.c +1 −2 Original line number Diff line number Diff line Loading @@ -9,10 +9,9 @@ */ #include <linux/device.h> #include "../base.h" #include "power.h" extern int sysdev_suspend(pm_message_t state); /* * The entries in the dpm_active list are in a depth first order, simply * because children are guaranteed to be discovered after parents, and Loading