Skip to contentSkip to conversation

microblaze: Disabling interrupt should return 1 if was enabled

PATCH New Michal Simek 4 participants 6 messages Dec 21, 2010 – Jan 9, 2011 Microblaze architecture

lore
Share & tools
lore

Michal Simek

author maintainer
#0 lore raw

PATCH v2 1/1 microblaze: Disabling interrupt should return 1 if was enabled

Microblaze implement enable/disable interrupts through MSR that's why disable_interrupts function should return 1 when interrupt was enabled. Return 0 when interrupt was disabled.

---
 arch/microblaze/cpu/interrupts.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/microblaze/cpu/interrupts.c +3 -1
index e9d53c1..054e09f 100644
@@ -41,8 +41,10 @@ void enable_interrupts (void)
 
 int disable_interrupts (void)
 {
+	unsigned int msr;
+	MFS(msr, rmsr);
 	MSRCLR(0x2);
-	return 0;
+	return ((msr & 0x2) != 0);
 }
 
 #ifdef CONFIG_SYS_INTC_0
Signature · 1 line
1.5.5.6
#1 lore raw

PATCH v2 1/1 microblaze: Disabling interrupt should return 1 if was enabled

Hello.

Quoted 6 lines · Michal Simek

Microblaze implement enable/disable interrupts through MSR that's why disable_interrupts function should return 1 when interrupt was enabled. Return 0 when interrupt was disabled.

[...]

arch/microblaze/cpu/interrupts.c void enable_interrupts (void) · line 44

Quoted 9 lines
arch/microblaze/cpu/interrupts.c +1 -0
index e9d53c1..054e09f 100644
@@ -41,8 +41,10 @@ void enable_interrupts (void)
 
  int disable_interrupts (void)
  {
+	unsigned int msr;

Empty line wouldn't hurt here...

arch/microblaze/cpu/interrupts.c void enable_interrupts (void) · line 47

Quoted 4 lines
arch/microblaze/cpu/interrupts.c +2 -1
+	MFS(msr, rmsr);
  	MSRCLR(0x2);
-	return 0;
+	return ((msr & 0x2) != 0);

External pair of () not needed.

WBR, Sergei

#2 lore raw

PATCH v2 1/1 microblaze: Disabling interrupt should return 1 if was enabled

In reply to Michal Simek

Dear Michal Simek,

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

Microblaze implement enable/disable interrupts through MSR that's why disable_interrupts function should return 1 when interrupt was enabled. Return 0 when interrupt was disabled.

---
 arch/microblaze/cpu/interrupts.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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
"Have you lived in this village all your life?"        "No, not yet."
#3 lore raw

PATCH v2 1/1 microblaze: Disabling interrupt should return 1 if was enabled

Dear Wolfgang Denk,

I'm Abraham Yu, here is my first time write to you, I feel so happy to join the U-Boot team.

I was porting arm926ejs SoC to our new SoC call "AVT2210", OK! Here is some basically questions below:
(u-boot.1010.12.rc2 is what I am using.)

1). First, I am useing JTAG to download image to SDRAM, base address 0x40000000, (32M) so I confused with
"CONFIG_SYS_TEXT_BASE", I think this this the relocate address, I am right? Could you please help me choose a address for me can working. (I choose 0x41F00000, at last crash on relocate: copy_loop)

2). Second, CONFIG_SYS_INIT_SP_ADDR address is also obscure, I choose 0x42000000, at last crash on relocate: copy_loop)

3). What other thing I should do?

Thanks very much, God bless you.

Abraham

#4 lore raw

[U-Boot] Porting Questions - was: [PATCH v2] microblaze: Disabling interrupt should return 1 if was enabled

Dear =?GBK?B?09q74Q==?=,

Please do not hijack existing mail threads!!

Start a new thread, and make sure to chose a proper subject.

Please make sure to use a line length of 70 characters or so.

And never post HTML to that list.

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

1). First, I am useing JTAG to download image to SDRAM, base address 0x40000000, (32M) so I confused with
"CONFIG_SYS_TEXT_BASE", I think this this the relocate address, I am right? Could you please help me choose a address for me can working. (I choose 0x41F00000, at last crash on relocate: copy_loop)

No, CONFIG_SYS_TEXT_BASE is NOT the relocation address. The relocation address gets dynamically computed and may vary. CONFIG_SYS_TEXT_BASE is the base address of the text segment when linking the U-Boot image.

Quoted 1 line

2). Second, CONFIG_SYS_INIT_SP_ADDR address is also obscure, I choose 0x42000000, at last crash on relocate: copy_loop)

As the name attempts to suggest, CONFIG_SYS_INIT_SP_ADDR defines the address of the initial steck pointer in the restricted C runtime environment before relocation.

Quoted 1 line

3). What other thing I should do?

Read the documentation and especially existing code for other, similar boards.

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
Microsoft Multitasking:
                     several applications can crash at the same time.
#5 lore raw

PATCH v2 1/1 microblaze: Disabling interrupt should return 1 if was enabled

In reply to Michal Simek

Dear Michal Simek,

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

Microblaze implement enable/disable interrupts through MSR that's why disable_interrupts function should return 1 when interrupt was enabled. Return 0 when interrupt was disabled.

---
 arch/microblaze/cpu/interrupts.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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
A stone was placed at a ford in a river with the inscription:
"When this stone is covered it is dangerous to ford here."