<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>ColdFire/68K Microcontrollers and Processors中的主题 Mapping i/o peripherals on flexbus</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Mapping-i-o-peripherals-on-flexbus/m-p/190954#M8285</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;I'm writing to you because i'm having trouble with I/O peripheral mapping on new kernel 2.6.38 on M5445x platform.&lt;BR /&gt;I work with a custom platform based on M54452 and we have some peripherals on Flexbus on chip select 2 and chip select 3.&lt;BR /&gt;I don't understand how mapping these peripherals on Linux. I've already read all threads about this topic, but I didn't resolve my problem. With previous kernel 2.6.25, I used "ioremap()" to map my peripheral in my device drivers, and it works. With new kernel 2.6.38 it doesn't work anymore..I check on new code of "ioremap" in kmap.c and I seen that there is a new check on KMAP_START and KMAP_END.&lt;BR /&gt;For kernel 2.6.25 and kernel 2.6.38 KMAP_START and KMAP_END are the same.&lt;BR /&gt;In practice, the situation is this:&lt;/P&gt;&lt;P&gt;#if defined(CONFIG_M5445X) || defined(CONFIG_M547X_8X)&lt;BR /&gt;#define VMALLOC_START 0xc0000000&lt;BR /&gt;#define VMALLOC_END 0xcfffffff&lt;BR /&gt;#define KMAP_START (VMALLOC_END + 1)&lt;BR /&gt;#define KMAP_END (0xe8000000 – 1)&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;Instead "ioremap" in two kernels are slightly different.&lt;/P&gt;&lt;P&gt;Kernel 2.6.38:&lt;BR /&gt;--------------------------------------------------------------------------&lt;BR /&gt;if ((physaddr &amp;gt;=KMAP_START) &amp;amp;&amp;amp; (physaddr &amp;lt;= KMAP_END)) {&lt;BR /&gt;/* if physaddr belongs to virtual address range for ioremap,&lt;BR /&gt;* then return physaddr because it has been ioremapped&lt;BR /&gt;*/&lt;BR /&gt;return (void __iomem *)physaddr;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Kernel 2.6.25:&lt;BR /&gt;--------------------------------------------------------------------------&lt;BR /&gt;if ((physaddr &amp;gt;=0xa0000000) &amp;amp;&amp;amp; (physaddr &amp;lt;= 0xb0000000)) {&lt;BR /&gt;/* if physaddr belongs to virtual address range for ioremap,&lt;BR /&gt;* then return physaddr because it has been ioremapped&lt;BR /&gt;*/&lt;BR /&gt;return (void __iomem *)physaddr;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;So, I would like to map my peripherals in this mode replacing ATA physical address because in our platform (M54452) we haven't ATA controller :&lt;BR /&gt;#define PERIPHERAL_1_BASE_PHY 0x90000000&lt;BR /&gt;#define PERIPHERAL_2_BASE_PHY 0x90010000&lt;BR /&gt;#define PERIPHERAL_3_BASE_PHY 0x90020000&lt;/P&gt;&lt;P&gt;but using "ioremap" these physical addresses doesn't work.&lt;BR /&gt;Instead if I use physical addresses in 0xC0000000 - 0xE8000000 range, and I disable check on ((physaddr &amp;gt;=KMAP_START) &amp;amp;&amp;amp; (physaddr &amp;lt;= KMAP_END)) in ioremap(), everything works. I don't understand the reason. Why I should map my devices on range between VMALLOC_START and KMAP_END?&lt;BR /&gt;There is something of strange...&lt;BR /&gt;Can you explain me, please?&lt;BR /&gt;Thank you very much for your support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Dec 2011 17:28:43 GMT</pubDate>
    <dc:creator>frendi</dc:creator>
    <dc:date>2011-12-19T17:28:43Z</dc:date>
    <item>
      <title>Mapping i/o peripherals on flexbus</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Mapping-i-o-peripherals-on-flexbus/m-p/190954#M8285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;I'm writing to you because i'm having trouble with I/O peripheral mapping on new kernel 2.6.38 on M5445x platform.&lt;BR /&gt;I work with a custom platform based on M54452 and we have some peripherals on Flexbus on chip select 2 and chip select 3.&lt;BR /&gt;I don't understand how mapping these peripherals on Linux. I've already read all threads about this topic, but I didn't resolve my problem. With previous kernel 2.6.25, I used "ioremap()" to map my peripheral in my device drivers, and it works. With new kernel 2.6.38 it doesn't work anymore..I check on new code of "ioremap" in kmap.c and I seen that there is a new check on KMAP_START and KMAP_END.&lt;BR /&gt;For kernel 2.6.25 and kernel 2.6.38 KMAP_START and KMAP_END are the same.&lt;BR /&gt;In practice, the situation is this:&lt;/P&gt;&lt;P&gt;#if defined(CONFIG_M5445X) || defined(CONFIG_M547X_8X)&lt;BR /&gt;#define VMALLOC_START 0xc0000000&lt;BR /&gt;#define VMALLOC_END 0xcfffffff&lt;BR /&gt;#define KMAP_START (VMALLOC_END + 1)&lt;BR /&gt;#define KMAP_END (0xe8000000 – 1)&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;Instead "ioremap" in two kernels are slightly different.&lt;/P&gt;&lt;P&gt;Kernel 2.6.38:&lt;BR /&gt;--------------------------------------------------------------------------&lt;BR /&gt;if ((physaddr &amp;gt;=KMAP_START) &amp;amp;&amp;amp; (physaddr &amp;lt;= KMAP_END)) {&lt;BR /&gt;/* if physaddr belongs to virtual address range for ioremap,&lt;BR /&gt;* then return physaddr because it has been ioremapped&lt;BR /&gt;*/&lt;BR /&gt;return (void __iomem *)physaddr;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Kernel 2.6.25:&lt;BR /&gt;--------------------------------------------------------------------------&lt;BR /&gt;if ((physaddr &amp;gt;=0xa0000000) &amp;amp;&amp;amp; (physaddr &amp;lt;= 0xb0000000)) {&lt;BR /&gt;/* if physaddr belongs to virtual address range for ioremap,&lt;BR /&gt;* then return physaddr because it has been ioremapped&lt;BR /&gt;*/&lt;BR /&gt;return (void __iomem *)physaddr;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;So, I would like to map my peripherals in this mode replacing ATA physical address because in our platform (M54452) we haven't ATA controller :&lt;BR /&gt;#define PERIPHERAL_1_BASE_PHY 0x90000000&lt;BR /&gt;#define PERIPHERAL_2_BASE_PHY 0x90010000&lt;BR /&gt;#define PERIPHERAL_3_BASE_PHY 0x90020000&lt;/P&gt;&lt;P&gt;but using "ioremap" these physical addresses doesn't work.&lt;BR /&gt;Instead if I use physical addresses in 0xC0000000 - 0xE8000000 range, and I disable check on ((physaddr &amp;gt;=KMAP_START) &amp;amp;&amp;amp; (physaddr &amp;lt;= KMAP_END)) in ioremap(), everything works. I don't understand the reason. Why I should map my devices on range between VMALLOC_START and KMAP_END?&lt;BR /&gt;There is something of strange...&lt;BR /&gt;Can you explain me, please?&lt;BR /&gt;Thank you very much for your support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2011 17:28:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Mapping-i-o-peripherals-on-flexbus/m-p/190954#M8285</guid>
      <dc:creator>frendi</dc:creator>
      <dc:date>2011-12-19T17:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping i/o peripherals on flexbus</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Mapping-i-o-peripherals-on-flexbus/m-p/190955#M8286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I add some other info on my problem, so I hope that someone can help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I set up Flexbus chip select in this way:&lt;BR /&gt;CS1 --&amp;gt; BASE 0x90000000 with 64K window&lt;BR /&gt;CS2 --&amp;gt; BASE 0x90010000 with 64K window&lt;BR /&gt;CS3 --&amp;gt; BASE 0x90020000 with 64K window&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code extracted from 'arch/m68k/coldfire/m5445x/config.c' to set up chip select on Flexbus:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#if defined(CONFIG_PERIPHERAL_1) || defined(CONFIG_PERIPHERAL_1_MODULE)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSAR(1) = PERIPHERAL_1_BASE_PHY;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSMR(1) = MCF_FBCS_CSMR_BAM_64K | MCF_FBCS_CSMR_V;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR(1) = MCF_FBCS_CSCR_WRAH(0x00) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSCR_RDAH(0x00) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSCR_ASET(0x01) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSCR_WS(0x00) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSCR_AA |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSCR_PS_32 |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSCR_BEM;&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#if defined(CONFIG_PERIPHERAL_2) || defined(CONFIG_PERIPHERAL_2_MODULE)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSAR(2) = PERIPHERAL_2_BASE_PHY;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSMR(2) = MCF_FBCS_CSMR_BAM_64K | MCF_FBCS_CSMR_V;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSCR(2) = MCF_FBCS_CSCR_WRAH(0x00) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_RDAH(0x00) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_ASET(0x01) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_WS(0x00) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_AA |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_PS_32 |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_BEM;&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#if defined(CONFIG_PERIPHERAL_3) || defined(CONFIG_PERIPHERAL_3_MODULE)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSAR(3) = PERIPHERAL_3_BASE_PHY;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSMR(3) = MCF_FBCS_CSMR_BAM_64K | MCF_FBCS_CSMR_V;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MCF_FBCS_CSCR(3) = MCF_FBCS_CSCR_WRAH(0x00) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_RDAH(0x00) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_ASET(0x01) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_WS(0x00) |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_AA |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_PS_32 |&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MCF_FBCS_CSCR_BEM;&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in my drivers, I did 'ioremap()' ro remap this physical address to virtual kernel address in this way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static void * __iomem bus_va_base = NULL;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Remap I/O devices */&lt;BR /&gt;if (!request_mem_region(PERIPHERAL_1_BASE_PHY, PAGE_SIZE, "peripheral_1")) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printk(KERN_ERR "peripheral_1: request mem region failed");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sts = -EINVAL;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; goto init_fail;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;bus_va_base = ioremap(PERIPHERAL_1_BASE_PHY,PAGE_SIZE);&lt;BR /&gt;if(!bus_va_base){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printk("Can't map device!!!");&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; goto init_fail2;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then to write on that virtual address I use iowrite32be()/ioread32be() functions.&lt;BR /&gt;Debugging with Trace32, I can see that ﻿bus_va_base have ﻿﻿﻿0xD0000000 as virtual address of PERIPHERAL_1_BASE_PHY (0x90000000). Note that 0xD0000000 is where KMAP_START begin. I think that is everything is right, or not? Why I can't write to bus with addresses class?&lt;BR /&gt;Why, instead, if I choose as physical address 0xD0000000 and I remap it, can I write to bus?&lt;/P&gt;&lt;P&gt;At this point I can't understand how memory is mapped on m68k with Linux. I had some experience with ppc and arm, and Linux ran at 0xC0000000.&lt;BR /&gt;In m68k/coldfire arch, instead, Linux run at 0x40000000 with 1:1 map to SDRAM (SDRAM physical address is 0x40000000), so how virtual memory works?&lt;/P&gt;&lt;P&gt;Sorry for my bad english.&lt;BR /&gt;Thank you very much again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 19:20:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Mapping-i-o-peripherals-on-flexbus/m-p/190955#M8286</guid>
      <dc:creator>frendi</dc:creator>
      <dc:date>2011-12-20T19:20:46Z</dc:date>
    </item>
  </channel>
</rss>

