LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: mtd mount problem
From: Marco Schramel @ 2005-04-21 13:02 UTC (permalink / raw)
  To: PPC_LINUX
In-Reply-To: <20050421103234.ED367C1510@atlas.denx.de>

Hi,

> > 
> > /dev # date > /dev/mtd1
> > MTD_open
> > MTD_ioctl
> > MTD_write
> > MTD do_write_buffer(): software timeout
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ERROR ERROR ERROR ERROR ERROR ERROR ERROR

This only occurs if i write the second time to the flash memory without erasing it before.

> What has a ramdisk to do with this?

I wrote in a message later, that i meant the /dev nodes in this case. 

> What does "cat /proc/mtd" show? What are  the  kernel  boot  messages
> look like?
> 
mtd0: 01000000 00020000 "JFFS2 partition 1"
mtd1: 00800000 00020000 "JFFS2 partition 2"
mtd2: 00400000 00020000 "RAMDISK "
mtd3: 00300000 00020000 "kernel image 2_4"
mtd4: 00100000 00020000 "Das U-Boot "

Best regards
Marco

^ permalink raw reply

* Re: [PATCH 2.6.12-rc2] Freescale 8272ADS PCI bridge support to the stock linux-2.5 (updated)
From: Vitaly Bordug @ 2005-04-21 12:04 UTC (permalink / raw)
  To: Kumar Gala, linuxppc-embedded
In-Reply-To: <Pine.LNX.4.61.0504201401270.8563@linen.am.freescale.net>

Kumar Gala wrote:

>On Wed, 13 Apr 2005, Vitaly Bordug wrote:
>
>Finally, had some time to really look at this patch, comments are inline. 
>Look for (galak).  A few high level comments:
>
>Can we fold pq2ads_setup_hose into pq2ads_setup_pci? 
>
No problem, I think...

> Also, is there 
>anything to be done to unify m8260_setup_pci & 
>pq2ads_setup_pci..
>
Well, in my opinion, m8260_setup_pci should be replaced with 
pq2ads_setup_pci, as far as they are intended to do the same (as I 
mentioned in my very first PCI patch marked as RFC). But I actually 
cannot test this stuff on anything other than 8272ads, so this way I'm 
trying not to break existing code. The latter, BTW, currently has 
limited functionality and I _guess_ I will not break anything if only 
pq2ads_setup_pci remain. What do you think?

Other issues will be fixed shortly.

Thanks.


-- 
Sincerely, 
Vitaly

^ permalink raw reply

* Re: mtd mount problem
From: Wolfgang Denk @ 2005-04-21 10:32 UTC (permalink / raw)
  To: Marco Schramel; +Cc: PPC_LINUX
In-Reply-To: <200504211117.25584.Schramel.Linux@go.bartec.de>

In message <200504211117.25584.Schramel.Linux@go.bartec.de> you wrote:
> 
> /dev # date > /dev/mtd1
> MTD_open
> MTD_ioctl
> MTD_write
> MTD do_write_buffer(): software timeout
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ERROR ERROR ERROR ERROR ERROR ERROR ERROR

> MTD_close
> /dev #
> 
> It all seems to be fine, but...

I disagree. There was a  pretty  clear  error  message  above.  Don't
ignore this, it will bite you later.

> dev # mount -t jffs2 /dev/mtdblock1 /mnt/Flash1
> mount: Mounting /dev/mtdblock1 on /mnt/Flash1 failed: No such device

Assuming that this is a mount builtin to the  busybox,  this  message
means  that  there  is  no such file as "/dev/mtdblock1" in your root
file system - exactly as the error message says.

> I checked out the Majors of my ramdisk, they are ok.

What has a ramdisk to do with this?

What does "cat /proc/mtd" show? What are  the  kernel  boot  messages
look like?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"It was the Law of the Sea, they said. Civilization ends at  the  wa-
terline.  Beyond  that,  we  all enter the food chain, and not always
right at the top."                               - Hunter S. Thompson

^ permalink raw reply

* Preemption patch problem
From: Björn Östby @ 2005-04-21 10:08 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 890 bytes --]

Greetings.

I have been struggling with the famous preemption patch (from Robert Love) the past few days. Im using mpc823e 
and tried with kernels 2.4.{18,21,22,23}. The patch applies flawless and so on, but when the kernel is up and running
strange memory problems start to appear like:

_alloc_pages: 0-order allocation failed (gfp=0x1d2/0)

Right, so... It seems like a giant memory leak of some sort, cause when I run programs the kernel goes ballistic and
starts reaping processes:

"VM: Killing process <name>"

Eventually it comes down to "VM: killing init" and then it's curtains.

I know that these problems is caused by the patch since the kernel runs smooth without the patch applied.
Does anyone have a clue what to do here (beside let go of the patch)? 


Best regards,
Björn 
-----------------------------------------
"failure is not an option"





[-- Attachment #2: Type: text/html, Size: 2231 bytes --]

^ permalink raw reply

* Re: MPC8245 custom board, Linux 2.4 kernel hangs after uncompressing
From: Wolfgang Denk @ 2005-04-21 10:23 UTC (permalink / raw)
  To: Sam Song; +Cc: linuxppc-embedded
In-Reply-To: <20050421071910.46237.qmail@web15808.mail.cnb.yahoo.com>

In message <20050421071910.46237.qmail@web15808.mail.cnb.yahoo.com> you wrote:
>
> Interesting to me as well. I also have such a similar
> problem. But I wanna to know how I can return to 
> u-boot with software workaround after kernel hanging.

Press the reset button?

> At least, I must power-off and power-on my target to
> get back to u-boot console. If so, the last kernel 
> printk message would lost IMHO.

Isn't there a way to perform a hardware reset (by pressing the  reset
button, or through a JTAG debugger) ?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
You see things; and you say ``Why?'' But I dream  things  that  never
were; and I say ``Why not?''
       - George Bernard Shaw _Back to Methuselah_ (1921) pt. 1, act 1

^ permalink raw reply

* Re: MPC8245 custom board, Linux 2.4 kernel hangs after uncompressing
From: Sam Song @ 2005-04-21 10:03 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: linuxppc-embedded

Eugene Surovegin <ebs@ebshome.net> wrote:
> On Thu, Apr 21, 2005 at 03:19:10PM +0800, Sam Song
> wrote:
> > Interesting to me as well. I also have such a
> > similar problem. But I wanna to know how I can 
> > return to u-boot with software workaround after 
> > kernel hanging.
>
> Easy, use BDI (or any other hw debugger) and reset
> target when it hangs.

Thanks, Eugene. This one should work. It seems that 
I must use a HW tool to deal with my trouble.

Sam

_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/

^ permalink raw reply

* RE: MPC8245 custom board, Linux 2.4 kernel hangs after uncompressing
From: Sam Song @ 2005-04-21  9:58 UTC (permalink / raw)
  To: Atit_Shah, kishorekrd; +Cc: linuxppc-embedded

--- Atit_Shah <Atit_Shah@satyam.com> wrote:
> I forgot to mention this...u should do a soft reset.
> If you go about powering off and on your board your
> buffer will be flushed. But for a soft reset the
> contents will be retained.

Ummm, in my experience, if kernel hangs, either it
could reboot automatically or it will stop there 
and doesn't respone any input from serial console. My
situation is the second. So soft reset couldn't work
at all:)

Thanks,

Sam


_________________________________________________________
Do You Yahoo!?
注册世界一流品质的雅虎免费电邮
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/

^ permalink raw reply

* Re: mtd mount problem
From: Daniel Ann @ 2005-04-21  9:54 UTC (permalink / raw)
  To: Marco Schramel; +Cc: PPC_LINUX
In-Reply-To: <200504211117.25584.Schramel.Linux@go.bartec.de>

On 4/21/05, Marco Schramel <Schramel.Linux@go.bartec.de> wrote:
> It all seems to be fine, but...
>=20
> dev # mount -t jffs2 /dev/mtdblock1 /mnt/Flash1
> mount: Mounting /dev/mtdblock1 on /mnt/Flash1 failed: No such device

Shouldnt you be doing eraseall first ? It seems to me, you were
writing output of date to the flash earlier.

If you get No such device, it maybe that your configuration of bus
width, and base address could be wrong. (I take it that you did
configure the physmap)

--=20
Daniel

^ permalink raw reply

* Re: mtd mount problem
From: Marco Schramel @ 2005-04-21  9:44 UTC (permalink / raw)
  To: Eugene Surovegin; +Cc: PPC_LINUX
In-Reply-To: <20050421085037.GB8189@gate.ebshome.net>

Hi Eugene,

thanks for your answer

> Check that you have CONFIG_MTD_BLOCK enabled in your .config. 
#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=0
CONFIG_MTD_PARTITIONS=y
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_REDBOOT_PARTS is not set
# CONFIG_MTD_CMDLINE_PARTS is not set
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set
# CONFIG_INFTL is not set

> 
> Also, check that you have /dev/mtdblock1 node in /dev directory on the 
> target.
>

This is what i meant before with ramdisk. 

/dev # ls -al mtdblock1
brw-rw-r--    1 root     root      31,   1 Mar 17  2005 mtdblock1

It should be ok. Isn't it ??

Thanks
Marco



-- 
---------
Marco Schramel

^ permalink raw reply

* Re: mtd mount problem
From: Eugene Surovegin @ 2005-04-21  8:50 UTC (permalink / raw)
  To: Marco Schramel; +Cc: PPC_LINUX
In-Reply-To: <200504211117.25584.Schramel.Linux@go.bartec.de>

On Thu, Apr 21, 2005 at 11:17:25AM +0200, Marco Schramel wrote:
> Hi all,
> 
> in our system (MPC8270, 2.4.25) i can't mount the mtd devices (two AM29LV256MH)
> 
> I created a map based on tqm8260.c. I can use the "eraseall" command and i can write the mtdx devices.
> But if i try to mount the mtd devices (jffs or jffs2) then it fails.
> Output:
> The eraseall command
> /dev # eraseall /dev/mtd1
> MTD_open
> MTD_ioctl
> MTD_write
> Erased 8192 Kibyte @ 0 -- 100% complete.
> MTD_close
> 
> try to write
> /dev # date > /dev/mtd1
> MTD_open
> MTD_ioctl
> MTD_write
> MTD_close
> 
> ok, now try onesmore
> /dev # date > /dev/mtd1
> MTD_open
> MTD_ioctl
> MTD_write
> MTD do_write_buffer(): software timeout
> MTD_close
> /dev #
> 
> It all seems to be fine, but...
> 
> dev # mount -t jffs2 /dev/mtdblock1 /mnt/Flash1
> mount: Mounting /dev/mtdblock1 on /mnt/Flash1 failed: No such device
> 
> I checked out the Majors of my ramdisk, they are ok.

ramdisk? why?

Check that you have CONFIG_MTD_BLOCK enabled in your .config. 

Also, check that you have /dev/mtdblock1 node in /dev directory on the 
target.

-- 
Eugene

^ permalink raw reply

* RE: MPC8245 custom board, Linux 2.4 kernel hangs after uncompressing
From: Atit_Shah @ 2005-04-21  8:45 UTC (permalink / raw)
  To: Sam Song, kishorekrd; +Cc: linuxppc-embedded

I forgot to mention this...u should do a soft reset. If you go about =
powering off and on your board your buffer will be flushed. But for a =
soft reset the contents will be retained.

-----Original Message-----
From: Sam Song [mailto:samlinuxppc@yahoo.com.cn]=20
Sent: Thursday, April 21, 2005 12:49 PM
To: Atit_Shah; kishorekrd@gmail.com
Cc: linuxppc-embedded@ozlabs.org
Subject: RE: MPC8245 custom board, Linux 2.4 kernel hangs after =
uncompressing=20

Atit_Shah <Atit_Shah@satyam.com> wrote=A3=BA
> 1. Check your log buffer...your console may not be
> initialized yet so all your printk are logged at a=20
> particular memory location. Checkout the
> System.map file in the Linux folder for "log_buf".
> The address that you have there subtract it with=20
> the kernel base address. Then in view your
> memory at that location. We used U-Boot so we gave
> the command
> =09
> 	md <log_buff address>

Interesting to me as well. I also have such a similar
problem. But I wanna to know how I can return to=20
u-boot with software workaround after kernel hanging.
At least, I must power-off and power-on my target to
get back to u-boot console. If so, the last kernel=20
printk message would lost IMHO.

Thanks,

Sam

P.S. Atit_Shah, if possibel, pls set your subscribing
setting  "...daily digest" as "no" to avoid reply
inconvenience on the title:)

_________________________________________________________
Do You Yahoo!?
150=CD=F2=C7=FAMP3=B7=E8=BF=F1=CB=D1=A3=AC=B4=F8=C4=FA=B4=B3=C8=EB=D2=F4=C0=
=D6=B5=EE=CC=C3
http://music.yisou.com/
=C3=C0=C5=AE=C3=F7=D0=C7=D3=A6=D3=D0=BE=A1=D3=D0=A3=AC=CB=D1=B1=E9=C3=C0=CD=
=BC=A1=A2=D1=DE=CD=BC=BA=CD=BF=E1=CD=BC
http://image.yisou.com
1G=BE=CD=CA=C71000=D5=D7=A3=AC=D1=C5=BB=A2=B5=E7=D3=CA=D7=D4=D6=FA=C0=A9=C8=
=DD=A3=A1
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mai=
l_1g/


DISCLAIMER:
This email (including any attachments) is intended for the sole use of =
the intended recipient/s and may contain material that is CONFIDENTIAL =
AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or =
copying or distribution or forwarding of any or all of the contents in =
this message is STRICTLY PROHIBITED. If you are not the intended =
recipient, please contact the sender by email and delete all copies; =
your cooperation in this regard is appreciated.

^ permalink raw reply

* mtd mount problem
From: Marco Schramel @ 2005-04-21  9:17 UTC (permalink / raw)
  To: PPC_LINUX

Hi all,

in our system (MPC8270, 2.4.25) i can't mount the mtd devices (two AM29LV256MH)

I created a map based on tqm8260.c. I can use the "eraseall" command and i can write the mtdx devices.
But if i try to mount the mtd devices (jffs or jffs2) then it fails.
Output:
The eraseall command
/dev # eraseall /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
Erased 8192 Kibyte @ 0 -- 100% complete.
MTD_close

try to write
/dev # date > /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
MTD_close

ok, now try onesmore
/dev # date > /dev/mtd1
MTD_open
MTD_ioctl
MTD_write
MTD do_write_buffer(): software timeout
MTD_close
/dev #

It all seems to be fine, but...

dev # mount -t jffs2 /dev/mtdblock1 /mnt/Flash1
mount: Mounting /dev/mtdblock1 on /mnt/Flash1 failed: No such device

I checked out the Majors of my ramdisk, they are ok.

Any ideas.

Best regards and thank you in advance.

Marco



-- 
---------
Marco Schramel

^ permalink raw reply

* Re: MPC8245 custom board, Linux 2.4 kernel hangs after uncompressing
From: Eugene Surovegin @ 2005-04-21  7:46 UTC (permalink / raw)
  To: Sam Song; +Cc: Atit_Shah, linuxppc-embedded, kishorekrd
In-Reply-To: <20050421071910.46237.qmail@web15808.mail.cnb.yahoo.com>

On Thu, Apr 21, 2005 at 03:19:10PM +0800, Sam Song wrote:
> Interesting to me as well. I also have such a similar
> problem. But I wanna to know how I can return to 
> u-boot with software workaround after kernel hanging.
> At least, I must power-off and power-on my target to
> get back to u-boot console. If so, the last kernel 
> printk message would lost IMHO.

Easy, use BDI (or any other hw debugger) and reset target when it 
hangs.

-- 
Eugene

^ permalink raw reply

* RE: MPC8245 custom board, Linux 2.4 kernel hangs after uncompressing
From: Sam Song @ 2005-04-21  7:19 UTC (permalink / raw)
  To: Atit_Shah, kishorekrd; +Cc: linuxppc-embedded
In-Reply-To: <D8595042F3765A4285B848A78A2C2ED1027752@bsdmsg002.corp.satyam.ad>

Atit_Shah <Atit_Shah@satyam.com> wrote:
> 1. Check your log buffer...your console may not be
> initialized yet so all your printk are logged at a 
> particular memory location. Checkout the
> System.map file in the Linux folder for "log_buf".
> The address that you have there subtract it with 
> the kernel base address. Then in view your
> memory at that location. We used U-Boot so we gave
> the command
> 	
> 	md <log_buff address>

Interesting to me as well. I also have such a similar
problem. But I wanna to know how I can return to 
u-boot with software workaround after kernel hanging.
At least, I must power-off and power-on my target to
get back to u-boot console. If so, the last kernel 
printk message would lost IMHO.

Thanks,

Sam

P.S. Atit_Shah, if possibel, pls set your subscribing
setting  "...daily digest" as "no" to avoid reply
inconvenience on the title:)

_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/

^ permalink raw reply

* RE: Linuxppc-embedded Digest, Vol 8, Issue 56
From: Atit_Shah @ 2005-04-21  5:52 UTC (permalink / raw)
  To: kishorekrd; +Cc: linuxppc-embedded


Hi Kishore,

	There are various things you can try.

1. Check your log buffer...your console may not be initialized yet so
all your printk are logged at a particular memory location. Checkout the
System.map file in the Linux folder for "log_buf". The address that you
have there subtract it with the kernel base address. Then in view your
memory at that location. We used U-Boot so we gave the command
=09
	md <log_buff address>

2. We used a tool called Code Warrior which helped us single step debug
the code, it didn't help us much though.

3. We had a problem with the RAM in burst mode. WolfGang would suggest
you check out if your RAM is operational. In our case we had to set some
flag in the U-Boot code for RAM in burst mode. We changed this flag and
it boots fine. Well almost.

Atit


Message: 5
Date: Wed, 20 Apr 2005 18:00:46 -0700
From: Kishore Devireddy <kishorekrd@gmail.com>
Subject: MPC8245 custom board, Linux 2.4 kernel hangs after
	uncompressing
To: linuxppc-embedded@ozlabs.org
Message-ID: <2cf2641f0504201800556805d2@mail.gmail.com>
Content-Type: text/plain; charset=3DISO-8859-1

Hi

I am trying to run Embedded linux (ELDK) (2.4 kerenl) on a custom
powerpc board,
which is similar to Artis A3000 board. This board has
mpc8245(XPC8245LZY266B), natsemi 83815 ethernet, 4MB intel e28f320
flash, 16MB winbond w986432DH-6 SDRAM. So I configured and compiled
U-boot for A3000 borad. U-boot worked on my board also. Next I
compiled ELDK 3.0 for Sandpoint 8245 board and copied to flash. But
linux hangs after uncompressing

U-Boot 1.1.2 (Apr 14 2005 - 00:02:29)

CPU:   MPC8245 Revision 1.2 at 249.999 MHz: 16 kB I-Cache 16 kB D-Cache
Board: A3000 Local Bus at 99.999 MHz
I2C:   ready
DRAM:  16 MB
FLASH: Get flash bank 0 @ 0xffc00000
Manuf. ID @ 0xff800000: 0x00000089
Device ID @ 0xff800001: 0x00000016
## Flash bank 0 at 0xffc00000 sizes: 0x00400000
protect monitor fff00000 @ 40000
protect environtment fffc0000 @ 20000
## Final Flash bank sizes: 00400000
4 MB
      00  13  100b  0020  0200  ff
In:    serial
Out:   serial
Err:   serial
Net:   natsemi: EEPROM contents:
ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
dp83815#0
Warning: dp83815#0 MAC addresses don't match:
Address in SROM is         FF:FF:FF:FF:FF:FF
Address in environment is  00:40:05:B0:F1:BA

A3000> tftpboot 400000 uImage.eldk
Using dp83815#0 device
TFTP from server 192.168.1.124; our IP address is 192.168.1.54
Filename 'uImage.eldk'.
Load address: 0x400000
Loading:
#################################################################
       #################################################################
       ###################
done
Bytes transferred =3D 757926 (b90a6 hex)
A3000> bootm
## Booting image at 00400000 ...
 Image Name:   Linux-2.4.25
 Image Type:   PowerPC Linux Kernel Image (gzip compressed)
 Data Size:    757862 Bytes =3D 740.1 kB
 Load Address: 00000000
 Entry Point:  00000000
 Verifying Checksum ... OK
 Uncompressing Kernel Image ... OK

nothing happens after this until I reboot the board. I read u-boot FAQ
and configured bd_info structure same for both u-boot and Linux. I
found that CFG_IMMR is not applicable to MPC8245. I also used
clocks_in_mhz variable also before loading Linux. I am stuck here.
Could you please let me know what should I do next?

Thanks
Kishore


------------------------------

_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

End of Linuxppc-embedded Digest, Vol 8, Issue 56
************************************************


DISCLAIMER:
This email (including any attachments) is intended for the sole use of =
the intended recipient/s and may contain material that is CONFIDENTIAL =
AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or =
copying or distribution or forwarding of any or all of the contents in =
this message is STRICTLY PROHIBITED. If you are not the intended =
recipient, please contact the sender by email and delete all copies; =
your cooperation in this regard is appreciated.

^ permalink raw reply

* Re: Linux booting problem when initializing flash file system
From: Robin Gilks @ 2005-04-21  5:20 UTC (permalink / raw)
  To: Atit_Shah; +Cc: linuxppc-embedded
In-Reply-To: <D8595042F3765A4285B848A78A2C2ED1027750@bsdmsg002.corp.satyam.ad>

Atit_Shah wrote:
> Hi All,
> 
> 	I am using a board which has a ST Micro Electronics Flash
> (M29W640DB) and when booting the Linux Kernel I get the following error:
> 
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000:
> 0x0020 instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004:
> 0x22df instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c:
> 0x0008 instead
> 
> Further such events for this erase block will not be printed
> JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020000:
> 0x0020 instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020004:
> 0x22df instead
> jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0002000c:
> 0x0008 instead
> 
> And it ends with................
> 
> Cowardly refusing to erase blocks on filesystem with no valid JFFS2
> nodes
> Kernel panic: VFS: Unable to mount root fs on 1f:00
> <0>Rebooting in 180 seconds..
> 
> The reference board using an AMD flash works fine. I selected the ST
> Flash from make xconfig in Linux but the kernel crashes before it even
> calls start_kernel.
> Could somebody suggest wrong....
> 
> Thanks
> Atit

If the M29W640DB has the same problem as the M28W640ECB that I've used, 
then a fixup table entry may be required in drivers/mtd/cfi_cmdset_0001 
to say that buffered write is not supported.

You don't say which kernel or mtd version you are using - I'm assuming 
2.4 and an mtd about a year old!!

-- 
Robin Gilks
Senior Design Engineer          Phone: (+64)(3) 357 1569
Tait Electronics                Fax  :  (+64)(3) 359 4632
PO Box 1645 Christchurch        Email : robin.gilks@tait.co.nz
New Zealand

=======================================================================
This email, including any attachments, is only for the intended
addressee.  It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
 altered or corrupted during transmission.
=======================================================================

^ permalink raw reply

* Linux booting problem when initializing flash file system
From: Atit_Shah @ 2005-04-21  4:24 UTC (permalink / raw)
  To: linuxppc-embedded

Hi All,

	I am using a board which has a ST Micro Electronics Flash
(M29W640DB) and when booting the Linux Kernel I get the following error:

jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000:
0x0020 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004:
0x22df instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000000c:
0x0008 instead

Further such events for this erase block will not be printed
JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020000:
0x0020 instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00020004:
0x22df instead
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0002000c:
0x0008 instead

And it ends with................

Cowardly refusing to erase blocks on filesystem with no valid JFFS2
nodes
Kernel panic: VFS: Unable to mount root fs on 1f:00
<0>Rebooting in 180 seconds..

The reference board using an AMD flash works fine. I selected the ST
Flash from make xconfig in Linux but the kernel crashes before it even
calls start_kernel.
Could somebody suggest wrong....

Thanks
Atit




DISCLAIMER:
This email (including any attachments) is intended for the sole use of =
the intended recipient/s and may contain material that is CONFIDENTIAL =
AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or =
copying or distribution or forwarding of any or all of the contents in =
this message is STRICTLY PROHIBITED. If you are not the intended =
recipient, please contact the sender by email and delete all copies; =
your cooperation in this regard is appreciated.

^ permalink raw reply

* Re: 824x Sandpoint with 2.6.x
From: Sam Song @ 2005-04-21  2:40 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-embedded

"Mark A. Greer" <mgreer@mvista.com> wrote:
> > I cannot see any active info.Is early console
> > output message not enough to find out something 
> > useful? 
>
> Sure it does. You have to enable it, then add some
> progress lines to help narrow down where you're
> panic'ing/hanging. 

Well, the cmdline I added is the switch of early
console enable, which I should enable 
CONFIG_SERIAL_8250_CONSOLE in kernel config first. A
new and nice feature of 2.6.x to me.

> You can even use the
> progress facility to dump the __log_buf.

I don't have such experience. If possible, could u
give me a linkage or doc for me to have a look?

> I'm taking your unwillingness to use a jtag/cops
> debugger as indication
> that you don't have such a tool!?!?

For the moment, I don't have such a cute hardware 
tool which can support source code debug like 
BDI2000. To be frank, I haven't used a hardware tool 
to debug kernel. Perhaps the problem I met wasn't 
complicated to use it. But now it is another story:-)
BTW, Could I use KGDB to try it?

Thanks,

Sam

Best regards,

Sam

_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/

^ permalink raw reply

* MPC8245 custom board, Linux 2.4 kernel hangs after uncompressing
From: Kishore Devireddy @ 2005-04-21  1:00 UTC (permalink / raw)
  To: linuxppc-embedded

Hi

I am trying to run Embedded linux (ELDK) (2.4 kerenl) on a custom powerpc b=
oard,
which is similar to Artis A3000 board. This board has
mpc8245(XPC8245LZY266B), natsemi 83815 ethernet, 4MB intel e28f320
flash, 16MB winbond w986432DH-6 SDRAM. So I configured and compiled
U-boot for A3000 borad. U-boot worked on my board also. Next I
compiled ELDK 3.0 for Sandpoint 8245 board and copied to flash. But
linux hangs after uncompressing

U-Boot 1.1.2 (Apr 14 2005 - 00:02:29)

CPU:   MPC8245 Revision 1.2 at 249.999 MHz: 16 kB I-Cache 16 kB D-Cache
Board: A3000 Local Bus at 99.999 MHz
I2C:   ready
DRAM:  16 MB
FLASH: Get flash bank 0 @ 0xffc00000
Manuf. ID @ 0xff800000: 0x00000089
Device ID @ 0xff800001: 0x00000016
## Flash bank 0 at 0xffc00000 sizes: 0x00400000
protect monitor fff00000 @ 40000
protect environtment fffc0000 @ 20000
## Final Flash bank sizes: 00400000
4 MB
      00  13  100b  0020  0200  ff
In:    serial
Out:   serial
Err:   serial
Net:   natsemi: EEPROM contents:
ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff ffff
dp83815#0
Warning: dp83815#0 MAC addresses don't match:
Address in SROM is         FF:FF:FF:FF:FF:FF
Address in environment is  00:40:05:B0:F1:BA

A3000> tftpboot 400000 uImage.eldk
Using dp83815#0 device
TFTP from server 192.168.1.124; our IP address is 192.168.1.54
Filename 'uImage.eldk'.
Load address: 0x400000
Loading: #################################################################
       #################################################################
       ###################
done
Bytes transferred =3D 757926 (b90a6 hex)
A3000> bootm
## Booting image at 00400000 ...
 Image Name:   Linux-2.4.25
 Image Type:   PowerPC Linux Kernel Image (gzip compressed)
 Data Size:    757862 Bytes =3D 740.1 kB
 Load Address: 00000000
 Entry Point:  00000000
 Verifying Checksum ... OK
 Uncompressing Kernel Image ... OK

nothing happens after this until I reboot the board. I read u-boot FAQ
and configured bd_info structure same for both u-boot and Linux. I
found that CFG_IMMR is not applicable to MPC8245. I also used
clocks_in_mhz variable also before loading Linux. I am stuck here.
Could you please let me know what should I do next?

Thanks
Kishore

^ permalink raw reply

* Re: [PATCH 2.6.12-rc2] Freescale 8272ADS PCI bridge support to the stock linux-2.5 (updated)
From: Kumar Gala @ 2005-04-20 20:56 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-embedded
In-Reply-To: <425D5885.2040605@ru.mvista.com>

On Wed, 13 Apr 2005, Vitaly Bordug wrote:

Finally, had some time to really look at this patch, comments are inline. 
Look for (galak).  A few high level comments:

Can we fold pq2ads_setup_hose into pq2ads_setup_pci?  Also, is there 
anything to be done to unify pq2ads_setup_pci & m8260_setup_pci..

> Kumar,
> This patch adds support for the MPC8272ADS PCI bridge.
> 
> The previous one is cleaned up after the final review.
> 
> Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>

===== arch/ppc/Kconfig 1.109 vs edited =====
--- 1.109/arch/ppc/Kconfig	2005-04-04 07:03:47 +04:00
+++ edited/arch/ppc/Kconfig	2005-04-12 16:47:48 +04:00
@@ -1123,7 +1123,7 @@
 
 config PCI_8260
 	bool
-	depends on PCI && 8260 && !8272
+	depends on PCI && 8260 
 	default y
 
 config 8260_PCI9
===== arch/ppc/platforms/pq2ads.h 1.3 vs edited =====
--- 1.3/arch/ppc/platforms/pq2ads.h	2005-01-16 01:01:51 +03:00
+++ edited/arch/ppc/platforms/pq2ads.h	2005-04-13 20:38:43 +04:00
@@ -49,10 +49,10 @@
 /* PCI interrupt controller */
 #define PCI_INT_STAT_REG	0xF8200000
 #define PCI_INT_MASK_REG	0xF8200004
-#define PIRQA			(NR_SIU_INTS + 0)
-#define PIRQB			(NR_SIU_INTS + 1)
-#define PIRQC			(NR_SIU_INTS + 2)
-#define PIRQD			(NR_SIU_INTS + 3)
+#define PIRQA			(NR_CPM_INTS + 0)
+#define PIRQB			(NR_CPM_INTS + 1)
+#define PIRQC			(NR_CPM_INTS + 2)
+#define PIRQD			(NR_CPM_INTS + 3)
 
 /*
  * PCI memory map definitions for MPC8266ADS-PCI.
@@ -71,6 +71,7 @@
 /* window for a PCI master to access MPC8266 memory */
 #define PCI_SLV_MEM_LOCAL	0x00000000	/* Local base */
 #define PCI_SLV_MEM_BUS		0x00000000	/* PCI base */
+#define PCI_SLV_MEM_SIZE	0x10000000	/* 256 Mb */
 
 /* window for the processor to access PCI memory with prefetching */
 #define PCI_MSTR_MEM_LOCAL	0x80000000	/* Local base */
@@ -83,9 +84,75 @@
 #define PCI_MSTR_MEMIO_SIZE	0x20000000	/* 512MB */
 
 /* window for the processor to access PCI I/O */
+#if !defined(CONFIG_ADS8272) && !defined(CONFIG_PQ2FADS)
+
 #define PCI_MSTR_IO_LOCAL	0xF4000000	/* Local base */
 #define PCI_MSTR_IO_BUS         0x00000000	/* PCI base   */
 #define PCI_MSTR_IO_SIZE        0x04000000	/* 64MB */
+
+#else /* CONFIG_ADS8272 or CONFIG_PQ2FADS */
+
+#define PCI_MSTR_IO_LOCAL	0xF6000000	/* Local base */

(galak -- white space versus tabs, use tabs)

+#define PCI_MSTR_IO_BUS         0x00000000	/* PCI base   */
+#define PCI_MSTR_IO_SIZE        0x02000000	/* 64MB */
+

(galak -- the defn of SIUMCR & SCCR probably belong in 
include/asm-ppc/cpm2.h)

+/*-----------------------------------------------------------------------
+ * SIUMCR - SIU Module Configuration Register				 4-31
+ */
+#define SIUMCR_BBD	0x80000000	/* Bus Busy Disable		*/
+#define SIUMCR_ESE	0x40000000	/* External Snoop Enable	*/
+#define SIUMCR_PBSE	0x20000000	/* Parity Byte Select Enable	*/
+#define SIUMCR_CDIS	0x10000000	/* Core Disable			*/
+#define SIUMCR_DPPC00	0x00000000	/* Data Parity Pins Configuration*/
+#define SIUMCR_DPPC01	0x04000000	/* - " -			*/
+#define SIUMCR_DPPC10	0x08000000	/* - " -			*/
+#define SIUMCR_DPPC11	0x0c000000	/* - " -			*/
+#define SIUMCR_L2CPC00	0x00000000	/* L2 Cache Pins Configuration	*/
+#define SIUMCR_L2CPC01	0x01000000	/* - " -			*/
+#define SIUMCR_L2CPC10	0x02000000	/* - " -			*/
+#define SIUMCR_L2CPC11	0x03000000	/* - " -			*/
+#define SIUMCR_LBPC00	0x00000000	/* Local Bus Pins Configuration	*/
+#define SIUMCR_LBPC01	0x00400000	/* - " -			*/
+#define SIUMCR_LBPC10	0x00800000	/* - " -			*/
+#define SIUMCR_LBPC11	0x00c00000	/* - " -			*/
+#define SIUMCR_APPC00	0x00000000	/* Address Parity Pins Configuration*/
+#define SIUMCR_APPC01	0x00100000	/* - " -			*/
+#define SIUMCR_APPC10	0x00200000	/* - " -			*/
+#define SIUMCR_APPC11	0x00300000	/* - " -			*/
+#define SIUMCR_CS10PC00	0x00000000	/* CS10 Pin Configuration	*/
+#define SIUMCR_CS10PC01	0x00040000	/* - " -			*/
+#define SIUMCR_CS10PC10	0x00080000	/* - " -			*/
+#define SIUMCR_CS10PC11	0x000c0000	/* - " -			*/
+#define SIUMCR_BCTLC00	0x00000000	/* Buffer Control Configuration	*/
+#define SIUMCR_BCTLC01	0x00010000	/* - " -			*/
+#define SIUMCR_BCTLC10	0x00020000	/* - " -			*/
+#define SIUMCR_BCTLC11	0x00030000	/* - " -			*/
+#define SIUMCR_MMR00	0x00000000	/* Mask Masters Requests	*/
+#define SIUMCR_MMR01	0x00004000	/* - " -			*/
+#define SIUMCR_MMR10	0x00008000	/* - " -			*/
+#define SIUMCR_MMR11	0x0000c000	/* - " -			*/
+#define SIUMCR_LPBSE	0x00002000	/* LocalBus Parity Byte Select Enable*/
+
+/*-----------------------------------------------------------------------
+ * SCCR - System Clock Control Register					 9-8
+ */
+#define SCCR_PCI_MODE	0x00000100	/* PCI Mode	*/
+#define SCCR_PCI_MODCK	0x00000080	/* Value of PCI_MODCK pin	*/
+#define SCCR_PCIDF_MSK	0x00000078	/* PCI division factor	*/
+#define SCCR_PCIDF_SHIFT 3
+  
+#endif
+
+#if defined(CONFIG_ADS8272)
+#define PCI_INT_TO_SIU 	SIU_INT_IRQ2
+#elif defined(CONFIG_PQ2FADS)
+#define PCI_INT_TO_SIU 	SIU_INT_IRQ6
+#else
+#warning PCI Bridge will be without interrupts support
+#endif
+
+#define POTA_ADDR_SHIFT 	12
+#define PITA_ADDR_SHIFT 	12
 
 #define _IO_BASE		PCI_MSTR_IO_LOCAL
 #define _ISA_MEM_BASE		PCI_MSTR_MEMIO_LOCAL
===== arch/ppc/syslib/Makefile 1.51 vs edited =====
--- 1.51/arch/ppc/syslib/Makefile	2005-03-31 14:59:04 +04:00
+++ edited/arch/ppc/syslib/Makefile	2005-04-12 16:47:50 +04:00
@@ -82,6 +82,9 @@
 				   todc_time.o
 obj-$(CONFIG_8260)		+= m8260_setup.o
 obj-$(CONFIG_PCI_8260)		+= m8260_pci.o indirect_pci.o
+ifeq ($(CONFIG_ADS8272),y)
+obj-$(CONFIG_PCI)		+= pci_auto.o
+endif
 obj-$(CONFIG_8260_PCI9)		+= m8260_pci_erratum9.o
 obj-$(CONFIG_CPM2)		+= cpm2_common.o cpm2_pic.o
 ifeq ($(CONFIG_PPC_GEN550),y)
===== arch/ppc/syslib/m8260_pci.c 1.2 vs edited =====
--- 1.2/arch/ppc/syslib/m8260_pci.c	2004-06-17 16:57:15 +04:00
+++ edited/arch/ppc/syslib/m8260_pci.c	2005-04-13 20:38:02 +04:00
@@ -1,4 +1,7 @@

(galak -- add your info after wolfgang & rhat)

 /*
+ * 2005 (c) MontaVista Software, Inc.
+ * Vitaly Bordug <vbordug@ru.mvista.com>
+ *
  * (C) Copyright 2003
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
@@ -28,6 +31,8 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
+#include <linux/irq.h>
+#include <linux/interrupt.h>
 
 #include <asm/byteorder.h>
 #include <asm/io.h>
@@ -38,12 +43,144 @@
 #include <asm/immap_cpm2.h>
 #include <asm/mpc8260.h>
 
+#if !defined(CONFIG_ADS8272) && !defined(CONFIG_PQ2FADS)
 #include "m8260_pci.h"
+#endif
+
+/*
+ * Interrupt routing
+ */
+
+static inline int
+pq2pci_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
+{
+	static char pci_irq_table[][4] =
+	/*
+	 *	PCI IDSEL/INTPIN->INTLINE
+	 * 	  A      B      C      D
+	 */
+	{
+		{ PIRQA, PIRQB, PIRQC, PIRQD },	/* IDSEL 22 - PCI slot 0 */
+		{ PIRQD, PIRQA, PIRQB, PIRQC },	/* IDSEL 23 - PCI slot 1 */
+		{ PIRQC, PIRQD, PIRQA, PIRQB },	/* IDSEL 24 - PCI slot 2 */
+	};
+
+	const long min_idsel = 22, max_idsel = 24, irqs_per_slot = 4;
+	return PCI_IRQ_TABLE_LOOKUP;
+}
+
+static void
+pq2pci_mask_irq(unsigned int irq)
+{
+	int bit = irq - NR_CPM_INTS;
+
+	*(volatile unsigned long *) PCI_INT_MASK_REG |=  (1 << (31 - bit));
+	return;
+}
+
+static void
+pq2pci_unmask_irq(unsigned int irq)
+{
+	int bit = irq - NR_CPM_INTS;
+
+	*(volatile unsigned long *) PCI_INT_MASK_REG &= ~(1 << (31 - bit));
+	return;
+}
+
+static void
+pq2pci_mask_and_ack(unsigned int irq)
+{
+	int bit = irq - NR_CPM_INTS;
+
+	*(volatile unsigned long *) PCI_INT_MASK_REG |=  (1 << (31 - bit));
+	return;
+}
+
+static void
+pq2pci_end_irq(unsigned int irq)
+{
+	int bit = irq - NR_CPM_INTS;
+
+	*(volatile unsigned long *) PCI_INT_MASK_REG &= ~(1 << (31 - bit));
+	return;
+}
+
+struct hw_interrupt_type pq2pci_ic = {
+	"PQ2 PCI",
+	NULL,
+	NULL,
+	pq2pci_unmask_irq,
+	pq2pci_mask_irq,
+	pq2pci_mask_and_ack,
+	pq2pci_end_irq,
+	0
+};
+
+static irqreturn_t
+pq2pci_irq_demux(int irq, void *dev_id, struct pt_regs *regs)
+{
+	unsigned long stat, mask, pend;
+	int bit;
+
+	for(;;) {
+		stat = *(volatile unsigned long *) PCI_INT_STAT_REG;
+		mask = *(volatile unsigned long *) PCI_INT_MASK_REG;
+		pend = stat & ~mask & 0xf0000000;
+		if (!pend)
+			break;
+		for (bit = 0; pend != 0; ++bit, pend <<= 1) {
+			if (pend & 0x80000000)
+				__do_IRQ(NR_CPM_INTS + bit, regs);
+		}
+	}
+
+	return IRQ_HANDLED;
+}
+
+static struct irqaction pq2pci_irqaction = {
+	.handler = pq2pci_irq_demux,
+	.flags 	 = SA_INTERRUPT,
+	.mask	 = CPU_MASK_NONE,
+	.name	 = "PQ2 PCI cascade",
+};
+
+
+void
+pq2pci_init_irq(void)
+{
+	int irq;
+	volatile cpm2_map_t *immap = cpm2_immr;
+#ifdef CONFIG_ADS8272
+	/* configure chip select for PCI interrupt controller */
+	immap->im_memctl.memc_br3 = PCI_INT_STAT_REG | 0x00001801;
+	immap->im_memctl.memc_or3 = 0xffff8010;
+#endif
+	for (irq = NR_CPM_INTS; irq < NR_CPM_INTS + 4; irq++)
+                irq_desc[irq].handler = &pq2pci_ic;
+
+	/* make PCI IRQ level sensitive */ 
+	immap->im_intctl.ic_siexr &=
+		~(1 << (14 - (PCI_INT_TO_SIU - SIU_INT_IRQ1)));
+	
+	/* mask all PCI interrupts */
+	*(volatile unsigned long *) PCI_INT_MASK_REG |= 0xfff00000;
+
+	/* install the demultiplexer for the PCI cascade interrupt */
+	setup_irq(PCI_INT_TO_SIU, &pq2pci_irqaction);	
+	return;
+}
+
+static int                     
+pq2pci_exclude_device(u_char bus, u_char devfn)
+{
+	return PCIBIOS_SUCCESSFUL;
+}
 
 
 /* PCI bus configuration registers.
  */
 
+#if !defined(CONFIG_ADS8272) && !defined(CONFIG_PQ2FADS)
 static void __init m8260_setup_pci(struct pci_controller *hose)
 {
 	volatile cpm2_map_t *immap = cpm2_immr;
@@ -146,10 +283,148 @@
 				tempShort | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);
 }
 
-void __init m8260_find_bridges(void)
+#else /* setup hardware for 8272ADS and PQ2FADS */
+
+static void 
+pq2ads_setup_pci(struct pci_controller *hose)
+{
+	__u32 val;
+	volatile cpm2_map_t *immap = cpm2_immr;
+	bd_t* binfo = (bd_t*) __res;
+	u32 sccr = immap->im_clkrst.car_sccr;
+	uint pci_div,freq,time;
+		/* PCI int lowest prio  */
+	/* Each 4 bits is a device bus request      and the MS 4bits
+	   is highest priority */
+	/* Bus                4bit value
+	   ---                ----------
+	   CPM high      	0b0000
+	   CPM middle           0b0001
+	   CPM low       	0b0010
+	   PCI reguest          0b0011
+	   Reserved      	0b0100
+	   Reserved      	0b0101
+	   Internal Core     	0b0110
+	   External Master 1 	0b0111
+	   External Master 2 	0b1000
+	   External Master 3 	0b1001
+	   The rest are reserved 
+	 */
+	immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x61207893;
+	/* park bus on core  */
+	immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_CORE;
+	/*
+	 * Set up master windows that allow the CPU to access PCI space. These
+	 * windows are set up using the two SIU PCIBR registers.
+	 */
+
+	immap->im_memctl.memc_pcimsk0 = ~(PCI_MSTR_IO_SIZE - 1U);
+	immap->im_memctl.memc_pcibr0  = PCI_MSTR_IO_LOCAL | PCIBR_ENABLE;
+	
+	immap->im_memctl.memc_pcimsk1 = ~(PCI_MSTR_MEM_SIZE + PCI_MSTR_MEMIO_SIZE - 1U);
+	immap->im_memctl.memc_pcibr1  = PCI_MSTR_MEM_LOCAL | PCIBR_ENABLE;
+#ifdef CONFIG_ADS8272
+	immap->im_siu_conf.siu_82xx.sc_siumcr = (immap->im_siu_conf.siu_82xx.sc_siumcr &

(galak typically we do this a foo & ~(A | B | C | D )

+				~SIUMCR_BBD &
+				~SIUMCR_ESE &
+				~SIUMCR_PBSE &
+				~SIUMCR_CDIS &
+				~SIUMCR_DPPC11 &
+				~SIUMCR_L2CPC11 &
+				~SIUMCR_LBPC11 &
+				~SIUMCR_APPC11 &
+				~SIUMCR_CS10PC11 &
+				~SIUMCR_BCTLC11 &
+				~SIUMCR_MMR11)
+			| SIUMCR_DPPC11 | SIUMCR_L2CPC01 | SIUMCR_LBPC00
+			| SIUMCR_APPC10 | SIUMCR_CS10PC00 | SIUMCR_BCTLC00 | SIUMCR_MMR11;
+#elif defined CONFIG_PQ2FADS
+	/*
+	 * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]),
+	 * and local bus for PCI (SIUMCR [LBPC]).
+	 */
+	immap->im_siu_conf.siu_82xx.sc_siumcr = (immap->im_siu_conf.sc_siumcr &
+				~SIUMCR_LBPC11 &
+				~SIUMCR_CS10PC11 &
+				~SIUMCR_LBPC11) |
+				SIUMCR_LBPC01 | SIUMCR_CS10PC01 | SIUMCR_APPC10;
+#endif
+        /* Enable PCI  */
+	immap->im_pci.pci_gcr = cpu_to_le32(PCIGCR_PCI_BUS_EN);
+	
+	pci_div = ( (sccr & SCCR_PCI_MODCK) ? 2 : 1) *
+			( ( (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT) + 1);
+	freq = (uint)((2*binfo->bi_cpmfreq)/(pci_div));
+	time = (int)666666/freq;
+	/* due to PCI Local Bus spec, some devices needs to wait such a long 
+	time after RST 	deassertion. More specifically, 0.508s for 66MHz & twice more for 33 */
+	printk("%s: The PCI bus is %d Mhz.\nWaiting %s after deasserting RST...\n",__FILE__,freq,
+	(time==1) ? "0.5 seconds":"1 second" );
+	
+	{
+	    int i;
+	    for(i=0;i<(500*time);i++)
+		    udelay(1000);
+	}	
+						
+	/* setup ATU registers */
+	immap->im_pci.pci_pocmr0 = cpu_to_le32(POCMR_ENABLE | POCMR_PCI_IO |
+	                  ((~(PCI_MSTR_IO_SIZE - 1U)) >> POTA_ADDR_SHIFT));
+	immap->im_pci.pci_potar0 = cpu_to_le32(PCI_MSTR_IO_BUS >> POTA_ADDR_SHIFT);
+	immap->im_pci.pci_pobar0 = cpu_to_le32(PCI_MSTR_IO_LOCAL >> POTA_ADDR_SHIFT);
+
+	/* Set-up non-prefetchable window */
+	immap->im_pci.pci_pocmr1 = cpu_to_le32(POCMR_ENABLE | ((~(PCI_MSTR_MEMIO_SIZE-1U)) >> POTA_ADDR_SHIFT));
+	immap->im_pci.pci_potar1 = cpu_to_le32(PCI_MSTR_MEMIO_BUS >> POTA_ADDR_SHIFT);
+	immap->im_pci.pci_pobar1 = cpu_to_le32(PCI_MSTR_MEMIO_LOCAL >> POTA_ADDR_SHIFT);
+
+	/* Set-up prefetchable window */
+	immap->im_pci.pci_pocmr2 = cpu_to_le32(POCMR_ENABLE |POCMR_PREFETCH_EN |
+                  (~(PCI_MSTR_MEM_SIZE-1U) >> POTA_ADDR_SHIFT));
+	immap->im_pci.pci_potar2 = cpu_to_le32((PCI_MSTR_MEM_BUS) >> POTA_ADDR_SHIFT);
+	immap->im_pci.pci_pobar2 = cpu_to_le32((PCI_MSTR_MEM_LOCAL) >> POTA_ADDR_SHIFT);
+
+ 	/* Inbound transactions from PCI memory space */
+	immap->im_pci.pci_picmr0 = cpu_to_le32(PICMR_ENABLE | PICMR_PREFETCH_EN |
+				    ((~(PCI_SLV_MEM_SIZE-1U)) >> PITA_ADDR_SHIFT));
+	immap->im_pci.pci_pibar0 = cpu_to_le32(PCI_SLV_MEM_BUS  >> PITA_ADDR_SHIFT);
+	immap->im_pci.pci_pitar0 = cpu_to_le32(PCI_SLV_MEM_LOCAL>> PITA_ADDR_SHIFT);
+
+#if defined CONFIG_ADS8272
+	/* PCI int highest prio  */
+	immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x01236745;
+#elif defined CONFIG_PQ2FADS
+	immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x03124567;
+#endif
+	/* park bus on PCI  */
+	immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_PCI;
+
+	/* Enable bus mastering and inbound memory transactions */
+	early_read_config_dword(hose, hose->first_busno, 0, PCI_COMMAND, &val);
+	val &= 0xffff0000;
+   	val |= PCI_COMMAND_MEMORY|PCI_COMMAND_MASTER;
+	early_write_config_dword(hose, hose->first_busno, 0, PCI_COMMAND, val);	
+
+}  
+
+static void pq2ads_setup_hose(struct pci_controller * hose)
+{
+	hose->io_space.start =  MPC826x_PCI_LOWER_IO;
+	hose->io_space.end =  MPC826x_PCI_UPPER_IO;
+	hose->mem_space.start =  MPC826x_PCI_LOWER_MEM;
+	hose->mem_space.end =   MPC826x_PCI_UPPER_MMIO;
+	hose->io_base_virt =  (void*)MPC826x_PCI_IO_BASE;
+	isa_io_base = MPC826x_PCI_IO_BASE;
+}
+
+#endif
+
+
+void __init pq2_find_bridges(void)
 {
 	extern int pci_assign_all_busses;
 	struct pci_controller * hose;
+	int host_bridge;
 
 	pci_assign_all_busses = 1;
 
@@ -164,18 +439,45 @@
 	hose->bus_offset = 0;
 	hose->last_busno = 0xff;
 
+#ifdef CONFIG_ADS8272
+	hose->set_cfg_type = 1;
+#endif
+
 	setup_m8260_indirect_pci(hose, 
 				 (unsigned long)&cpm2_immr->im_pci.pci_cfg_addr,
 				 (unsigned long)&cpm2_immr->im_pci.pci_cfg_data);
 
+	/* Make sure it is a supported bridge */
+	early_read_config_dword(hose,
+			        0,
+			        PCI_DEVFN(0,0),
+			        PCI_VENDOR_ID,
+			        &host_bridge);
+	switch (host_bridge) {
+		case PCI_DEVICE_ID_MPC8265:
+			break;
+		case PCI_DEVICE_ID_MPC8272:
+			break;
+		default:
+			printk("Attempting to use unrecognized host bridge ID"
+			       " 0x%08x.\n", host_bridge);
+			break;
+	}
+
+#if defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS)
+	pq2ads_setup_pci(hose);  
+	pq2ads_setup_hose(hose);  
+#else
 	m8260_setup_pci(hose);
+
         hose->pci_mem_offset = MPC826x_PCI_MEM_OFFSET;
 
-        isa_io_base =
+	isa_io_base =
                 (unsigned long) ioremap(MPC826x_PCI_IO_BASE,
                                         MPC826x_PCI_IO_SIZE);
         hose->io_base_virt = (void *) isa_io_base;
- 
+#endif
+
         /* setup resources */
         pci_init_resource(&hose->mem_resources[0],
 			  MPC826x_PCI_LOWER_MEM,
@@ -191,4 +493,15 @@
 			  MPC826x_PCI_LOWER_IO,
 			  MPC826x_PCI_UPPER_IO,
 			  IORESOURCE_IO, "PCI I/O");
+
+#if defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS)
+	ppc_md.pci_exclude_device = pq2pci_exclude_device;
+	hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
+
+	ppc_md.pci_map_irq = pq2pci_map_irq;
+	ppc_md.pcibios_fixup = NULL;
+	ppc_md.pcibios_fixup_bus = NULL;
+
+#endif
+
 }
===== arch/ppc/syslib/m8260_setup.c 1.30 vs edited =====
--- 1.30/arch/ppc/syslib/m8260_setup.c	2005-03-31 14:59:04 +04:00
+++ edited/arch/ppc/syslib/m8260_setup.c	2005-04-13 20:33:52 +04:00
@@ -34,7 +34,11 @@
 unsigned char __res[sizeof(bd_t)];
 
 extern void cpm2_reset(void);
+#if !defined(CONFIG_ADS8272) && !defined(CONFIG_PQ2FADS)
 extern void m8260_find_bridges(void);
+#endif
+extern void pq2_find_bridges(void);
+extern void pq2pci_init_irq(void);
 extern void idma_pci9_init(void);
 
 /* Place-holder for board-specific init */
@@ -56,7 +60,11 @@
 	idma_pci9_init();
 #endif
 #ifdef CONFIG_PCI_8260
+#if defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS)
+	pq2_find_bridges();
+#else
 	m8260_find_bridges();
+#endif 
 #endif
 #ifdef CONFIG_BLK_DEV_INITRD
 	if (initrd_start)
@@ -173,6 +181,12 @@
 	 * in case the boot rom changed something on us.
 	 */
 	cpm2_immr->im_intctl.ic_siprr = 0x05309770;
+
+#if defined(CONFIG_PCI) && (defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS))
+ 	/* Initialize stuff for the 82xx CPLD IC and install demux  */
+ 	pq2pci_init_irq();
+#endif
+
 }
 
 /*
@@ -195,6 +209,9 @@
 m8260_map_io(void)
 {
 	uint addr;

(galak is this io_block_mapping needed? we are trying to avoid using 
io_block_mapping )

+#if defined(CONFIG_PCI) && (defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS))
+	io_block_mapping(0x80000000,0x80000000,0x10000000, _PAGE_IO);
+#endif
 
 	/* Map IMMR region to a 256MB BAT */
 	addr = (cpm2_immr != NULL) ? (uint)cpm2_immr : CPM_MAP_ADDR;
===== include/asm-ppc/m8260_pci.h 1.1 vs edited =====
--- 1.1/include/asm-ppc/m8260_pci.h	2004-06-17 02:56:05 +04:00
+++ edited/include/asm-ppc/m8260_pci.h	2005-04-12 17:17:29 +04:00
@@ -19,6 +19,7 @@
  * Define the vendor/device ID for the MPC8265.
  */
 #define	PCI_DEVICE_ID_MPC8265	((0x18C0 << 16) | PCI_VENDOR_ID_MOTOROLA)
+#define	PCI_DEVICE_ID_MPC8272	((0x18C1 << 16) | PCI_VENDOR_ID_MOTOROLA)
 
 #define M8265_PCIBR0	0x101ac
 #define M8265_PCIBR1	0x101b0

^ permalink raw reply

* Re: Marvell 64360, MPSC Serial Console Problem
From: Mark A. Greer @ 2005-04-20 19:41 UTC (permalink / raw)
  To: Suresh Chandra Mannava; +Cc: linuxppc-embedded
In-Reply-To: <4266A320.20102@gamebox.net>

Suresh Chandra Mannava wrote:

> <snip>
>
> We faced a problem in MPSC serial console part.  The problem is,  in 
> Serial console data is received once after 32 characters are typed.
>
> Any thing less than  32 characters  is not  echoed or not transmitted 
> till the 32 character count is reached.
>
> After carefully reviewing the code. We found that the receive buffer 
> size is initialised to 32 bytes.
> We made a small correction in the code by making the receive buffer 
> size to 1
> rxre->bufsize = 1;

<snip>

Suresh,

I think you fixed a symptom but not the problem.  By default, the rx 
buffers are indeed 32 bytes long (i.e., a cacheline in size).  When 
receiving, the mpsc will generate an interrupt when there is an error, 
when the buffer is full (32 bytes--unlikely if you're typing), or after 
a timeout.  I suspect your timeout value is bogus so you don't get the 
interrupt until you fill the buffer with 32 bytes.  Please compare the 
platform_data that you pass to the mpsc driver to other, working systems 
that use the mpsc (e.g., katana and cpci690).  In particular, look at 
your 'max_idle' value.

Mark

^ permalink raw reply

* Marvell 64360, MPSC Serial Console Problem
From: Suresh Chandra Mannava @ 2005-04-20 18:44 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-embedded
In-Reply-To: <421B666B.205@mvista.com>

Dear Mr. Mark,

We designed a board with PPC 7410 and Marvell 64360 bridge.  We  
successfully  ported u-boot and Linux on to this board.

Thanks for your support.

We faced a problem in MPSC serial console part.  The problem is,  in 
Serial console data is received once after 32 characters are typed.

Any thing less than  32 characters  is not  echoed or not transmitted 
till the 32 character count is reached.

After carefully reviewing the code. We found that the receive buffer 
size is initialised to 32 bytes.
We made a small correction in the code by making the receive buffer size 
to 1
rxre->bufsize = 1;

After this modification, we got beautiful serial console working fine.

Here is the part of the code from "mpsc.c"

Function name "mpsc_init_rings"

    for (i = 0; i < MPSC_RXR_ENTRIES; i++) {
        rxre = (struct mpsc_rx_desc *)dp;

    /*    rxre->bufsize = cpu_to_be16(MPSC_RXBE_SIZE);*/ 
        rxre->bufsize = 1;  /* Modified Line*/
        rxre->bytecnt = cpu_to_be16(0);
        rxre->cmdstat = cpu_to_be32(SDMA_DESC_CMDSTAT_O |
                        SDMA_DESC_CMDSTAT_EI |
                        SDMA_DESC_CMDSTAT_F |
                        SDMA_DESC_CMDSTAT_L);
        rxre->link = cpu_to_be32(dp_p + MPSC_RXRE_SIZE);
        rxre->buf_ptr = cpu_to_be32(bp_p);

        dp += MPSC_RXRE_SIZE;
        dp_p += MPSC_RXRE_SIZE;
        bp += MPSC_RXBE_SIZE;
        bp_p += MPSC_RXBE_SIZE;
    }


Once again thank you very much for your support.

Regards,
Suresh Chandra Mannava

^ permalink raw reply

* Re: 824x Sandpoint with 2.6.x
From: Mark A. Greer @ 2005-04-20 17:46 UTC (permalink / raw)
  To: Sam Song; +Cc: linuxppc-embedded
In-Reply-To: <20050420135401.29160.qmail@web15808.mail.cnb.yahoo.com>

Sam Song wrote:

>"Mark A. Greer" <mgreer@mvista.com> wrote:
>  
>
>>>Kernel command line:
>>>console=uart,mmio,0xfdfce500,115200n8
>>>console=ttyS0,115200
>>>root=/dev/ram rw ramdisk_size=200000
>>>ip=192.168.0.3:192.168..2:::sandpoint:et
>>>h0:off panic=1
>>>
>>>      
>>>
>><snip>
>>
>>Get rid of the
>>"console=uart,mmio,0xfdfce500,115200n8" part of the
>>cmdline and see what happens (keep the
>>"console=ttyS0,115200" part).
>>    
>>
>
>If so, kernel will hang after loading the kernel......
>

Okay, obviously something is wrong. Adding another console line isn't
fixing anything, its just allowing you to flounder on a little further.
IMHO, adding another console line isn't going to help and will only add
confusion.

>I cannot see any active info.Is early console output 
>message not enough to find out something useful? 
>  
>

Sure it does. You have to enable it, then add some progress lines to
help narrow down where you're panic'ing/hanging. You can even use the
progress facility to dump the __log_buf.

I'm taking your unwillingness to use a jtag/cops debugger as indication
that you don't have such a tool!?!?

Mark

^ permalink raw reply

* DMA Problem
From: Sanjay Bajaj @ 2005-04-20 17:37 UTC (permalink / raw)
  To: linuxppc-embedded

I am having a setup issue with the DMA channel 0 with the DMA Controller 
on PPC440GX. The code I wrote is:

#if defined(CONFIG_PPC4xx_DMA)
    /* Setup the DMA */
    DPRINTK("PPC4xx pwidth: %d\n", ppc4xx_get_peripheral_width(DMA_CH0));
    ppc4xx_set_dma_mode(DMA_CH0, DMA_MODE_READ);
    ppc4xx_set_src_addr(DMA_CH0, (phys_addr_t)(pdev->x2mem_phys_addr + 
src_addr));
    ppc4xx_set_dst_addr(DMA_CH0, (phys_addr_t)dst_addr);
    ppc4xx_set_dma_count(DMA_CH0, count);
    ppc4xx_enable_dma(DMA_CH0);
    DPRINTK("PPC4xx DMA Status: %d\n", ppc4xx_get_dma_status());
#endif

The DMA never completes and leaves a residue of 'count'. What am I missing?

Please Help.
Sanjay

^ permalink raw reply

* config file
From: Sriharsha Vardhan @ 2005-04-20 16:00 UTC (permalink / raw)
  To: linuxppc-embedded

Hi
I checked your thread about 2.6.11-5 on 8xx @
http://ozlabs.org/pipermail/linuxppc-embedded/2005-March/017468.html.

I am working on 860 and I tried both 2.6.11-5 and 2.6.11-7. I get
struck up exactly at same error  as you mentiond . i.e
  Linux/PPC load: rw root=3D/dev/ram0
  Uncompressing Linux...done.
  Now booting the kernel
 .....nothing after this..


I just want to cross check my config file. Can you please send me your
config file.

Have a nice day.

harsha

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox