Skip to contentSkip to conversation

QE IO - Add pario command

PATCH New David Saada 3 participants 10 messages Mar 31, 2008 – Apr 1, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 QE IO - Add pario command

This patch fragment includes commands for reading and writing parallel I/O ports (pario command).

common/cmd_pario.c | 85
+++++++++++++++++++++++++++++++++++++++++++++++++++
common/Makefile | 1

2 files changed, 86 insertions(+)

create mode 100644 common/cmd_pario.c

common/Makefile +1 -0
@@ -81,6 +81,7 @@ COBJS-$(CONFIG_CMD_NET) += cmd_net.o
 COBJS-y += cmd_nvedit.o
 COBJS-y += cmd_onenand.o
 COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
+COBJS-$(CONFIG_CMD_PARIO) += cmd_pario.o
 ifdef CONFIG_PCI
 COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
 endif

0a1,85

common/cmd_pario.c new file +83 -0

83 lines not on this page · raw message

<pin>\n"
+);
+

#1 lore raw

PATCH 3/3 QE IO - Add pario command

Quoted 2 lines · In message <[email protected]> you…

This patch fragment includes commands for reading and writing parallel I/O ports (pario command).

This sounds line a very general feature, but having a close look it seems that it is highly specialized on QE only.

As such, it does not qualify for such a generic command name.

Best regards,

Wolfgang Denk

Signature · 6 lines
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: wd at denx.de
Our OS who art in CPU, UNIX be thy name.
Thy programs run, thy syscalls done,
In kernel as it is in user!
#2 lore raw

PATCH 3/3 QE IO - Add pario command

Quoted 5 lines

This sounds line a very general feature, but having a close look it seems that it is highly specialized on QE only.

As such, it does not qualify for such a generic command name.

Wolfgang,
It is indeed a general feature, whose first implementation is for the QE. It can (and should) be extended for other CPU types. I wanted to add the CPM2 I/O setup, but I don't have a board to check this. If desired I can wrap the QE related calls with #ifdef QE...

David.

#3 lore raw

PATCH 3/3 QE IO - Add pario command

Quoted 5 lines · In message <[email protected]> you…

It is indeed a general feature, whose first implementation is for the QE. It can (and should) be extended for other CPU types. I wanted to add the CPM2 I/O setup, but I don't have a board to check this. If desired I can wrap the QE related calls with #ifdef QE...

I don't think is a good idea. The code as presented is actually not suited for such an extension. And I definitly don't want to plan for another #ifdef maze.

Are you aware of the "reginfo" command? Few people seem to know it.

Maybe you should add such code there.

Best regards,

Wolfgang Denk

Signature · 5 lines
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: wd at denx.de
When choosing between two evils, I always like to take the  one  I've
never tried before.                     -- Mae West, "Klondike Annie"
#4 lore raw

PATCH 3/3 QE IO - Add pario command

Quoted 8 lines

I don't think is a good idea. The code as presented is actually not suited for such an extension. And I definitly don't want to plan for another #ifdef maze.

Are you aware of the "reginfo" command? Few people seem to know it.

Maybe you should add such code there.

As far as I managed to understand, reginfo just shows a dump of CPU based register values, while pario allows you to set and get the value of a GPIO port - two different things. We found this very useful for debugging our board, and I think it can be useful for many other processor families as well.
David.

#5 lore raw

PATCH 3/3 QE IO - Add pario command

Quoted 5 lines · David Saada

As far as I managed to understand, reginfo just shows a dump of CPU based register values, while pario allows you to set and get the value of a GPIO port - two different things. We found this very useful for debugging our board, and I think it can be useful for many other processor families as well.

There is also a "qe" command that takes sub-commands as a parameter. Currently, the only one is "qe fw" for uploading firmware. Perhaps you could do "qe pario"?

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#6 lore raw

PATCH 3/3 QE IO - Add pario command

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 6 lines

As far as I managed to understand, reginfo just shows a dump of CPU based register values, while pario allows you to set and get the value of a GPIO port - two different things. We found this very useful for debugging our board, and I think it can be useful for many other processor families as well.

There is also a "qe" command that takes sub-commands as a parameter. Currently, the only one is "qe fw" for uploading firmware. Perhaps you could do "qe pario"?

Please don;t.

Instead of adding such functionality several times in several places distributed all over the whole source tree, let's do it just once and right.

Best regards,

Wolfgang Denk

Signature · 6 lines
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: wd at denx.de
Even historians fail to learn from history -- they repeat the same
mistakes.
	-- John Gill, "Patterns of Force", stardate 2534.7
#7 lore raw

PATCH 3/3 QE IO - Add pario command

In reply to David Saada
Quoted 7 lines · In message <[email protected]> you…
Quoted 6 lines

I don't think is a good idea. The code as presented is actually not suited for such an extension. And I definitly don't want to plan for another #ifdef maze.

Are you aware of the "reginfo" command? Few people seem to know it.

Quoted 7 lines
Quoted 1 line

Maybe you should add such code there.

As far as I managed to understand, reginfo just shows a dump of CPU based register values, while pario allows you to set and get the value of a GPIO port - two different things. We found this very useful for debugging our board, and I think it can be useful for many other processor families as well.

I'm aware of this. Changing register contents seems a useful extension to me, too. That's why I wrote "add such code". I think something like

Print all (or a predefined set of) registers:

	=> reg

Print a specific register:
=> reg name

Set a specific register to "value":
=> reg name value

would be generally useful, not only for parallel I/O registers.

Best regards,

Wolfgang Denk

Signature · 4 lines
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: wd at denx.de
"If it ain't broke, don't fix it."                       - Bert Lantz
#8 lore raw

PATCH 3/3 QE IO - Add pario command

Quoted 4 lines

I'm aware of this. Changing register contents seems a useful extension to me, too. That's why I wrote "add such code". I think something like

Print all (or a predefined set of) registers:

< => reg

Quoted 1 line

Print a specific register:

< => reg name

Quoted 4 lines

Set a specific register to "value":
=> reg name value

would be generally useful, not only for parallel I/O registers.

Specifying parallel I/O ports has whole registers is really
uncomfortable: If for example one would like to write a value to a parallel I/O port, then he'd need to read the data register first, then mask off all irrelevant bits, and then write the shifted value to this register. The pario command does this job in a much more comfortable way.
Again - we can keep this command in our boards' common code, but I think it would be a pity, as I think this functionality can be useful for many other CPU types as well.
David.

#9 lore raw

PATCH 3/3 QE IO - Add pario command

Quoted 13 lines · In message <[email protected]> you…
Quoted 4 lines

I'm aware of this. Changing register contents seems a useful extension to me, too. That's why I wrote "add such code". I think something like

Print all (or a predefined set of) registers:

< => reg

Quoted 1 line

Print a specific register:

< => reg name

Quoted 2 lines

Set a specific register to "value":
=> reg name value

Quoted 8 lines
Quoted 1 line

would be generally useful, not only for parallel I/O registers.

Specifying parallel I/O ports has whole registers is really
uncomfortable: If for example one would like to write a value to a parallel I/O port, then he'd need to read the data register first, then mask off all irrelevant bits, and then write the shifted value to this register. The pario command does this job in a much more comfortable way.

Nothing prevents you to write your code such that "name" is not a register name but a parallel port name, and that the code that handles it does exactly what you describe above transparently for the user.

Quoted 3 lines

Again - we can keep this command in our boards' common code, but I think it would be a pity, as I think this functionality can be useful for many other CPU types as well.

Agreed.

Best regards,

Wolfgang Denk

Signature · 6 lines
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: wd at denx.de
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
                                                      -- Isaac Asimov