1. 31 7月, 2014 2 次提交
    • H
      MIPS: Add NUMA support for Loongson-3 · c4617318
      Huacai Chen 提交于
      Multiple Loongson-3A chips can be interconnected with HT0-bus. This is
      a CC-NUMA system that every chip (node) has its own local memory and
      cache coherency is maintained by hardware. The 64-bit physical memory
      address format is as follows:
      
      0x-0000-YZZZ-ZZZZ-ZZZZ
      
      The high 16 bits should be 0, which means the real physical address
      supported by Loongson-3 is 48-bit. The "Y" bits is the base address of
      each node, which can be also considered as the node-id. The "Z" bits is
      the address offset within a node, which means every node has a 44 bits
      address space.
      
      Macros XPHYSADDR and MAX_PHYSMEM_BITS are modified unconditionally,
      because many other MIPS CPUs have also extended their address spaces.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7187/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c4617318
    • H
      MIPS: Loongson: Modify ChipConfig register definition · 140e39c1
      Huacai Chen 提交于
      This patch is prepared for Multi-chip interconnection. Since each chip
      has a ChipConfig register, LOONGSON_CHIPCFG should be an array.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/7185/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      140e39c1
  2. 27 5月, 2014 1 次提交
  3. 01 4月, 2014 2 次提交
    • H
      MIPS: Loongson 3: Add CPU hotplug support · c4a987db
      Huacai Chen 提交于
      Tips of Loongson's CPU hotplug:
      1, To fully shutdown a core in Loongson 3, the target core should go to
         CKSEG1 and flush all L1 cache entries at first. Then, another core
         (usually Core 0) can safely disable the clock of the target core. So
         play_dead() call loongson3_play_dead() via CKSEG1 (both uncached and
         unmmaped).
      2, The default clocksource of Loongson is MIPS. Since clock source is a
         global device, timekeeping need the CP0' Count registers of each core
         be synchronous. Thus, when a core is up, we use a SMP_ASK_C0COUNT IPI
         to ask Core-0's Count.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Signed-off-by: NHongliang Tao <taohl@lemote.com>
      Signed-off-by: NHua Yan <yanh@lemote.com>
      Tested-by: NAlex Smith <alex.smith@imgtec.com>
      Reviewed-by: NAlex Smith <alex.smith@imgtec.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/6639Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c4a987db
    • H
      MIPS: Loongson 3: Add Loongson-3 SMP support · 300459d5
      Huacai Chen 提交于
      IPI registers of Loongson-3 include IPI_SET, IPI_CLEAR, IPI_STATUS,
      IPI_EN and IPI_MAILBOX_BUF. Each bit of IPI_STATUS indicate a type of
      IPI and IPI_EN indicate whether the IPI is enabled. The sender write 1
      to IPI_SET bits generate IPIs in IPI_STATUS, and receiver write 1 to
      bits of IPI_CLEAR to clear IPIs. IPI_MAILBOX_BUF are used to deliver
      more information about IPIs.
      
      Why we change code in arch/mips/loongson/common/setup.c?
      
      If without this change, when SMP configured, system cannot boot since
      it hang at printk() in cgroup_init_early(). The root cause is:
      
      console_trylock()
        \-->down_trylock(&console_sem)
          \-->raw_spin_unlock_irqrestore(&sem->lock, flags)
            \-->_raw_spin_unlock_irqrestore()(SMP/UP have different versions)
              \-->__raw_spin_unlock_irqrestore()  (following is the SMP case)
                \-->do_raw_spin_unlock()
                  \-->arch_spin_unlock()
                    \-->nudge_writes()
                      \-->mb()
                        \-->wbflush()
                          \-->__wbflush()
      
      In previous code __wbflush() is initialized in plat_mem_setup(), but
      cgroup_init_early() is called before plat_mem_setup(). Therefore, In
      this patch we make changes to avoid boot failure.
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Signed-off-by: NHongliang Tao <taohl@lemote.com>
      Signed-off-by: NHua Yan <yanh@lemote.com>
      Tested-by: NAlex Smith <alex.smith@imgtec.com>
      Reviewed-by: NAlex Smith <alex.smith@imgtec.com>
      Cc: John Crispin <john@phrozen.org>
      Cc: Steven J. Hill <Steven.Hill@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: linux-mips@linux-mips.org
      Cc: Fuxin Zhang <zhangfx@lemote.com>
      Cc: Zhangjin Wu <wuzhangjin@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/6638Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      300459d5