Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
On Tuesday, April 20, 2010 20:45:12 Thomas Chou wrote: +void __led_init(led_id_t mask, int state) +{ + gpio_direction_output(mask, (state == STATUS_LED_ON) ? 0 : 1); +} + +void __led_set(led_id_t mask, int state) +{ + gpio_set_value(mask, (state == STATUS_LED_ON) ? 0 : 1); +} are these checks correct ? on means a value of 1 with GPIO lines, but here you're setting the value to 0 when the state is on. so perhaps they should both read: ..., state == STATUS_LED_ON); +void __led_toggle(led_id_t mask) +{ + gpio_set_value(mask, !gpio_get_value (mask)); +} no space before the (mask) -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
Dear Thomas Chou, In message 4bd7b0b3.3010...@wytron.com.tw you wrote: I sent a patch to enable some peripherals on the nios2-generic board. 04/28 [PATCH v2] nios2: add epcs, gpio led and mmc_spi to nios2-generic This patch should be applied after the other outstanding patches. Please let me know if this is all right? I don't understand how this is supposed to work? How can you enable a feature that has not been added yet? Will this not cause build errors? I guess to make sure the code remains bisectable both should be done in a single step? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de You humans have that emotional need to express gratitude. You're welcome, I believe, is the correct response. -- Spock, Bread and Circuses, stardate 4041.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
Dear Wolfgang, Wolfgang Denk wrote: Dear Thomas Chou, In message 4bd7b0b3.3010...@wytron.com.tw you wrote: I sent a patch to enable some peripherals on the nios2-generic board. 04/28 [PATCH v2] nios2: add epcs, gpio led and mmc_spi to nios2-generic This patch should be applied after the other outstanding patches. Please let me know if this is all right? I don't understand how this is supposed to work? How can you enable a feature that has not been added yet? Will this not cause build errors? It can't. I won't. It will. I guess to make sure the code remains bisectable both should be done in a single step? I have a few patches pending in such a state -- they will not be added until the prerequisites are met. I'd be glad to push the various prerequisite patches into a test branch ... but I've be far too busy. Regards, --Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
On 05/05/2010 06:30 AM, Wolfgang Denk wrote: Dear Thomas Chou, In message4bd7b0b3.3010...@wytron.com.tw you wrote: I sent a patch to enable some peripherals on the nios2-generic board. 04/28 [PATCH v2] nios2: add epcs, gpio led and mmc_spi to nios2-generic This patch should be applied after the other outstanding patches. Please let me know if this is all right? I don't understand how this is supposed to work? How can you enable a feature that has not been added yet? Will this not cause build errors? I guess to make sure the code remains bisectable both should be done in a single step? Best regards, Wolfgang Denk Hi Wolfgang and Scott, Please disregard the v2 patch on 04/28. I have resubmit the patch series in a way that they can be applied one-by-one without breaking others. I have tested the build on Altera dev boards using standard configuration. 04/30 [PATCH 0/6] add gpio_led and altera_spi drivers nios2: add gpio support misc: add gpio based status led driver nios2: add gpio support to nios2-generic board spi: add altera spi controller support spi_flash: support old STMicro parts with RES, v3 acked by Mike Frysinger. nios2: add spi flash support to nios2-generic board Best regards, Thomas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
On 04/26/2010 02:14 AM, Wolfgang Denk wrote: As long as no board actually uses this code we should put that patch on hold. Please resubmit it as part of the patch series that adds the first board that uses this code. Thanks. Hi Wolfgang, I sent a patch to enable some peripherals on the nios2-generic board. 04/28 [PATCH v2] nios2: add epcs, gpio led and mmc_spi to nios2-generic This patch should be applied after the other outstanding patches. Please let me know if this is all right? Best regards, Thomas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
Dear Thomas Chou, In message 4bd377c9.6010...@wytron.com.tw you wrote: The convention is not to add unused code. If there are no real users for this, the patch should be delayed until a board gets added that actually uses it. These nios2 boards are now supported with the nios2-generic board approach, like that of microblaze-generic, instead of adding every nios2 board to u-boot mainline. The nios2-generic board patch was applied to Scott's next branch. The gpio led can be enabled with the following added to the board config file. As long as no board actually uses this code we should put that patch on hold. Please resubmit it as part of the patch series that adds the first board that uses this code. Thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de It's all Klatchian to me. - Terry Pratchett Stephen Briggs, _The Discworld Companion_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
Dear Scott McNutt, In message 4bd39170.2040...@psyent.com you wrote: I mean, which board in U-Boot uses this code? I didn't find any. I think the most accurate answer is both all and none ... and I'm not trying to be funny or disrespectful in any way. It's just so very easy to replace peripherals with these FPGA based systems. Yes, but the current number of actual users so far is zero. However, the nios2 linux folks are very likely to use it (as a replacement). And, when they build u-boot, it will probably be configured using the nios2-generic board. So this isn't a rabbit in the hat ... the code will used. It's just not directly tied to a particular PCB from a traditional point of view. OK. Let's add the code when there is a user for it. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense. - E. W. Dijkstra ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
Dear Thomas Chou, In message 1271810712-16238-1-git-send-email-tho...@wytron.com.tw you wrote: This patch adds a status led driver followed the GPIO access conventions of Linux. The led mask is used to specify the gpio pin. Signed-off-by: Thomas Chou tho...@wytron.com.tw --- Moved to drivers/misc. Which boards are the users of this code? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Conceptual integrity in turn dictates that the design must proceed from one mind, or from a very small number of agreeing resonant minds. - Frederick Brooks Jr., The Mythical Man Month ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
On 04/25/2010 03:23 AM, Wolfgang Denk wrote: Dear Thomas Chou, In message1271810712-16238-1-git-send-email-tho...@wytron.com.tw you wrote: This patch adds a status led driver followed the GPIO access conventions of Linux. The led mask is used to specify the gpio pin. Signed-off-by: Thomas Choutho...@wytron.com.tw --- Moved to drivers/misc. Which boards are the users of this code? Best regards, Wolfgang Denk Hi Wolfgang, It is used in the example designs of Altera NEEK and DE2 boards, which I provided for nios2 linux/uclinux on nios wiki. They are used by many nios2 users. It may be used by other boards which support the GPIO access conventions of Linux. Though the GPIO access is not unified in u-boot currently, I think it should be the right direction to follow the conventions of Linux. Best regards, Thomas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
Dear Thomas Chou, In message 4bd36bae.2060...@wytron.com.tw you wrote: This patch adds a status led driver followed the GPIO access conventions of Linux. The led mask is used to specify the gpio pin. Signed-off-by: Thomas Choutho...@wytron.com.tw --- Moved to drivers/misc. Which boards are the users of this code? ... It is used in the example designs of Altera NEEK and DE2 boards, which I provided for nios2 linux/uclinux on nios wiki. They are used by many nios2 users. It may be used by other boards which support the GPIO access conventions of Linux. Though the GPIO access is not unified in u-boot currently, I think it should be the right direction to follow the conventions of Linux. I mean, which board in U-Boot uses this code? I didn't find any. The convention is not to add unused code. If there are no real users for this, the patch should be delayed until a board gets added that actually uses it. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de You are an excellent tactician, Captain. You let your second in com- mand attack while you sit and watch for weakness. -- Khan Noonian Singh, Space Seed, stardate 3141.9 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
On 04/25/2010 06:32 AM, Wolfgang Denk wrote: I mean, which board in U-Boot uses this code? I didn't find any. The convention is not to add unused code. If there are no real users for this, the patch should be delayed until a board gets added that actually uses it. Hi Wolfgang, These nios2 boards are now supported with the nios2-generic board approach, like that of microblaze-generic, instead of adding every nios2 board to u-boot mainline. The nios2-generic board patch was applied to Scott's next branch. The gpio led can be enabled with the following added to the board config file. /* * STATUS LED */ #define CONFIG_STATUS_LED/* Enable status driver */ #define CONFIG_GPIO_LED/* Enable gpio led driver */ #define STATUS_LED_BIT2/* Bit-2 on GPIO */ #define STATUS_LED_STATE1/* Blinking */ #define STATUS_LED_PERIOD(500 / CONFIG_SYS_NIOS_TMRMS) /* 500 msec */ Cheers, Thomas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] misc: add gpio based status led driver
Hi Wolfgang, Thomas Chou wrote: On 04/25/2010 06:32 AM, Wolfgang Denk wrote: I mean, which board in U-Boot uses this code? I didn't find any. I think the most accurate answer is both all and none ... and I'm not trying to be funny or disrespectful in any way. It's just so very easy to replace peripherals with these FPGA based systems. The convention is not to add unused code. If there are no real users for this, the patch should be delayed until a board gets added that actually uses it. My understanding is that the nios2 linux folks make use of the peripheral that this driver supports. However, the peripheral is not a standard Altera peripheral. In any case, it can essentially be used on any nios2 board as a replacement for the stock PIO peripheral. These nios2 boards are now supported with the nios2-generic board approach, like that of microblaze-generic, instead of adding every nios2 board to u-boot mainline. The nios2-generic board patch was applied to Scott's next branch. Correct. I asked Thomas to remove this peripheral from the Altera board tree because it was not associated with a _standard_ Altera peripheral. That is, anyone using the default configurations from Altera will never use this driver. However, the nios2 linux folks are very likely to use it (as a replacement). And, when they build u-boot, it will probably be configured using the nios2-generic board. So this isn't a rabbit in the hat ... the code will used. It's just not directly tied to a particular PCB from a traditional point of view. Regards, --Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot