1. 27 2月, 2010 2 次提交
    • W
      MIPS: Loongson: Remove the serial port output of compressed kernel support · c7e8c668
      Wu Zhangjin 提交于
      The compressed kernel support on loongson family machines is stable now,
      so, remove the debug information via using SYS_SUPPORTS_ZBOOT instead of
      SYS_SUPPORTS_ZBOOT_UART16550. This may reduce the image size and speedup
      the booting.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: yanh@lemote.com
      Cc: huhb@lemote.com
      Cc: zhangfx@lemote.com
      Patchwork: http://patchwork.linux-mips.org/patch/824/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c7e8c668
    • D
      MIPS: Octeon: Use optimized memory barrier primitives. · 6b07d38a
      David Daney 提交于
      In order to achieve correct synchronization semantics, the Octeon port
      had defined CONFIG_WEAK_REORDERING_BEYOND_LLSC.  This resulted in code
      that looks like:
      
         sync
         ll ...
         .
         .
         .
         sc ...
         .
         .
         sync
      
      The second SYNC was redundant, but harmless.
      
      Octeon has a SYNCW instruction that acts as a write-memory-barrier
      (due to an erratum in some parts two SYNCW are used).  It is much
      faster than SYNC because it imposes ordering on the writes, but
      doesn't otherwise stall the execution pipeline.  On Octeon, SYNC
      stalls execution until all preceeding writes are committed to the
      coherent memory system.
      
      Using:
      
          syncw;syncw
          ll
          .
          .
          .
          sc
          .
          .
      
      Has identical semantics to the first sequence, but is much faster.
      The SYNCW orders the writes, and the SC will not complete successfully
      until the write is committed to the coherent memory system.  So at the
      end all preceeding writes have been committed.  Since Octeon does not
      do speculative reads, this functions as a full barrier.
      
      The patch removes CONFIG_WEAK_REORDERING_BEYOND_LLSC, and substitutes
      SYNCW for SYNC in write-memory-barriers.
      Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com>
      To: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/850/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6b07d38a
  2. 28 1月, 2010 1 次提交
  3. 17 12月, 2009 16 次提交
    • M
      MIPS: No longer hardwire CONFIG_EMBEDDED to y · a4609780
      Martin Michlmayr 提交于
      There's no reason for MIPS to select EMBEDDED.  In fact, EMBEDDED makes
      MIPS more awkward to deal with because it makes it different to the
      majority of architectures for no good reason.
      
      [Ralf: Historically disabling EMBEDDED had hid essential options for many
       MIPS platforms such as serial console and forced crap like VGA support
       or power managment enabled for platforms where those don't make any sense.
      
       The name of the option is also _very_ missleading so many users don't
       select it even where is was required for a functioning kernel.]
      Signed-off-by: NMartin Michlmayr <tbm@cyrius.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/663/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a4609780
    • R
      MIPS: eXcite: Remove platform. · de4148f3
      Ralf Baechle 提交于
      The platform has never been fully merged 
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      Cc: Thomas Koeller <thomas.koeller@baslerweb.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Wim Van Sebroeck <wim@iguana.be>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mtd@lists.infradead.org
      Acked-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      Acked-by: NWim Van Sebroeck <wim@iguana.be>
      de4148f3
    • R
      MIPS: Move EARLY_PRINTK to Kconfig.debug · 4dd92e15
      Ralf Baechle 提交于
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4dd92e15
    • W
      MIPS: Tracing: Add function graph tracer support for MIPS · 29c5d346
      Wu Zhangjin 提交于
      The implementation of function graph tracer for MIPS is a little
      different from X86.
      
      in MIPS, gcc(with -pg) only transfer the caller's return address(at) and
      the _mcount's return address(ra) to us.
      
      For the kernel part without -mlong-calls:
      
      move at, ra
      jal _mcount
      
      For the module part with -mlong-calls:
      
      lui v1, hi16bit_of_mcount
      addiu v1, v1, low16bit_of_mcount
      move at, ra
      jal _mcount
      
      Without -mlong-calls,
      
      if the function is a leaf, it will not save the return address(ra):
      
      ffffffff80101298 <au1k_wait>:
      ffffffff80101298:       67bdfff0        daddiu  sp,sp,-16
      ffffffff8010129c:       ffbe0008        sd      s8,8(sp)
      ffffffff801012a0:       03a0f02d        move    s8,sp
      ffffffff801012a4:       03e0082d        move    at,ra
      ffffffff801012a8:       0c042930        jal     ffffffff8010a4c0 <_mcount>
      ffffffff801012ac:       00020021        nop
      
      so, we can hijack it directly in _mcount, but if the function is non-leaf, the
      return address is saved in the stack.
      
      ffffffff80133030 <copy_process>:
      ffffffff80133030:       67bdff50        daddiu  sp,sp,-176
      ffffffff80133034:       ffbe00a0        sd      s8,160(sp)
      ffffffff80133038:       03a0f02d        move    s8,sp
      ffffffff8013303c:       ffbf00a8        sd      ra,168(sp)
      ffffffff80133040:       ffb70098        sd      s7,152(sp)
      ffffffff80133044:       ffb60090        sd      s6,144(sp)
      ffffffff80133048:       ffb50088        sd      s5,136(sp)
      ffffffff8013304c:       ffb40080        sd      s4,128(sp)
      ffffffff80133050:       ffb30078        sd      s3,120(sp)
      ffffffff80133054:       ffb20070        sd      s2,112(sp)
      ffffffff80133058:       ffb10068        sd      s1,104(sp)
      ffffffff8013305c:       ffb00060        sd      s0,96(sp)
      ffffffff80133060:       03e0082d        move    at,ra
      ffffffff80133064:       0c042930        jal     ffffffff8010a4c0 <_mcount>
      ffffffff80133068:       00020021        nop
      
      but we can not get the exact stack address(which saved ra) directly in
      _mcount, we need to search the content of at register in the stack space
      or search the "s{d,w} ra, offset(sp)" instruction in the text. 'Cause we
      can not prove there is only a match in the stack space, so, we search
      the text instead.
      
      as we can see, if the first instruction above "move at, ra" is not a
      store instruction, there should be a leaf function, so we hijack the at
      register directly via putting &return_to_handler into it, otherwise, we
      search the "s{d,w} ra, offset(sp)" instruction to get the stack offset,
      and then the stack address. we use the above copy_process() as an
      example, we at last find "ffbf00a8", 0xa8 is the stack offset, we plus
      it with s8(fp), that is the stack address, we hijack the content via
      writing the &return_to_handler in.
      
      If with -mlong-calls, since there are two more instructions above "move
      at, ra", so, we can move the pointer to the position above "lui v1,
      hi16bit_of_mcount".
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/677/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      29c5d346
    • W
      MIPS: Tracing: Add dynamic function tracer support · 538f1952
      Wu Zhangjin 提交于
      With dynamic function tracer, by default, _mcount is defined as an
      "empty" function, it returns directly without any more action . When
      enabling it in user-space, it will jump to a real tracing
      function(ftrace_caller), and do the real job for us.
      
      Differ from the static function tracer, dynamic function tracer provides
      two functions ftrace_make_call()/ftrace_make_nop() to enable/disable the
      tracing of some indicated kernel functions(set_ftrace_filter).
      
      In the -v4 version, the implementation of this support is basically the same as
      X86 version does: _mcount is implemented as an empty function and ftrace_caller
      is implemented as a real tracing function respectively.
      
      But in this version, to support module tracing with the help of
      -mlong-calls in arch/mips/Makefile:
      
      MODFLAGS += -mlong-calls.
      
      The stuff becomes a little more complex. We need to cope with two
      different type of calling to _mcount.
      
      For the kernel part, the calling to _mcount(result of "objdump -hdr
      vmlinux"). is like this:
      
      	108:   03e0082d        move    at,ra
      	10c:   0c000000        jal     0 <fpcsr_pending>
                              10c: R_MIPS_26  _mcount
                              10c: R_MIPS_NONE        *ABS*
                              10c: R_MIPS_NONE        *ABS*
      	110:   00020021        nop
      
      For the module with -mlong-calls, it looks like this:
      
      	c:	3c030000 	lui	v1,0x0
      			c: R_MIPS_HI16	_mcount
      			c: R_MIPS_NONE	*ABS*
      			c: R_MIPS_NONE	*ABS*
      	10:	64630000 	daddiu	v1,v1,0
      			10: R_MIPS_LO16	_mcount
      			10: R_MIPS_NONE	*ABS*
      			10: R_MIPS_NONE	*ABS*
      	14:	03e0082d 	move	at,ra
      	18:	0060f809 	jalr	v1
      
      In the kernel version, there is only one "_mcount" string for every
      kernel function, so, we just need to match this one in mcount_regex of
      scripts/recordmcount.pl, but in the module version, we need to choose
      one of the two to match. Herein, I choose the first one with
      "R_MIPS_HI16 _mcount".
      
      and In the kernel verion, without module tracing support, we just need
      to replace "jal _mcount" by "jal ftrace_caller" to do real tracing, and
      filter the tracing of some kernel functions via replacing it by a nop
      instruction.
      
      but as we have described before, the instruction "jal ftrace_caller" only left
      32bit length for the address of ftrace_caller, it will fail when calling from
      the module space. so, herein, we must replace something else.
      
      the basic idea is loading the address of ftrace_caller to v1 via changing these
      two instructions:
      
      	lui	v1,0x0
      	addiu	v1,v1,0
      
      If we want to enable the tracing, we need to replace the above instructions to:
      
      	lui	v1, HI_16BIT_ftrace_caller
      	addiu	v1, v1, LOW_16BIT_ftrace_caller
      
      If we want to stop the tracing of the indicated kernel functions, we
      just need to replace the "jalr v1" to a nop instruction. but we need to
      replace two instructions and encode the above two instructions
      oursevles.
      
      Is there a simpler solution? Yes! Here it is, in this version, we put _mcount
      and ftrace_caller together, which means the address of _mcount and
      ftrace_caller is the same:
      
      _mcount:
      ftrace_caller:
      	j	ftrace_stub
      	 nop
      
      	...(do real tracing here)...
      
      ftrace_stub:
      	jr	ra
      	 move	ra, at
      
      By default, the kernel functions call _mcount, and then jump to ftrace_stub and
      return. and when we want to do real tracing, we just need to remove that "j
      ftrace_stub", and it will run through the two "nop" instructions and then do
      the real tracing job.
      
      what about filtering job? we just need to do this:
      
      	 lui v1, hi_16bit_of_mcount        <--> b 1f (0x10000004)
      	 addiu v1, v1, low_16bit_of_mcount
      	 move at, ra
      	 jalr v1
      	 nop
      	 				     1f: (rec->ip + 12)
      
      In linux-mips64, there will be some local symbols, whose name are
      prefixed by $L, which need to be filtered. thanks goes to Steven for
      writing the mips64-specific function_regex.
      
      In a conclusion, with RISC, things becomes easier with such a "stupid"
      trick, RISC is something like K.I.S.S, and also, there are lots of
      "simple" tricks in the whole ftrace support, thanks goes to Steven and
      the other folks for providing such a wonderful tracing framework!
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/675/Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      538f1952
    • W
      MIPS: Tracing: Enable HAVE_FUNCTION_TRACE_MCOUNT_TEST for MIPS · 69a7d1b3
      Wu Zhangjin 提交于
      There is an exisiting common ftrace_test_stop_func() in
      kernel/trace/ftrace.c, which is used to check the global variable
      ftrace_trace_stop to determine whether stop the function tracing.
      
      This patch implepment the MIPS specific one to speedup the procedure.
      
      Thanks goes to Zhang Le for Cleaning it up.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/673/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      69a7d1b3
    • W
      MIPS: Tracing: Add static function tracer support for MIPS · d2bb0762
      Wu Zhangjin 提交于
      If -pg of gcc is enabled with CONFIG_FUNCTION_TRACER=y. a calling to
      _mcount will be inserted into each kernel function. so, there is a
      possibility to trace the kernel functions in _mcount.
      
      This patch add the MIPS specific _mcount support for static function
      tracing. by default, ftrace_trace_function is initialized as
      ftrace_stub(an empty function), so, the default _mcount will introduce
      very little overhead. after enabling ftrace in user-space, it will jump
      to a real tracing function and do static function tracing for us.
      
      and -ffunction-sections is incompatible with -pg, so, disable it when
      ftracer is enabled.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Reviewed-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Nicholas Mc Guire <der.herr@hofr.at>
      Cc: zhangfx@lemote.com
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/672/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      d2bb0762
    • W
      MIPS: Add basic CPUFreq options. · 9726b43a
      Wu Zhangjin 提交于
      This patch adds basic options for MIPS CPUFreq support.
      
      Since the cp0 timer's frequency is based on the processor clockrate it can
      not be used with CPUFReq; an additional external timer is required.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: cpufreq@vger.kernel.org,
      Cc: Dave Jones <davej@redhat.com>,
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>,
      Cc: yanh@lemote.com
      Cc: huhb@lemote.com,
      Patchwork: http://patchwork.linux-mips.org/patch/659/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      9726b43a
    • D
      MIPS: PowerTV: Base files for Cisco PowerTV platform · a3a0f8c8
      David VomLehn 提交于
      Add the Cisco Powertv cable settop box to the MIPS tree. This platform is
      based on a MIPS 24Kc processor with various devices integrated on the same
      ASIC. There are multiple models of this box, with differing configuration
      but the same kernel runs across the product line.
      Signed-off-by: NDavid VomLehn <dvomlehn@cisco.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/132/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      a3a0f8c8
    • W
      MIPS: Add support for uncached accelerated mappings. · 22f1fdfd
      Wu Zhangjin 提交于
      Loongson2f support video acceleration.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: http://patchwork.linux-mips.org/patch/624/
      Patchwork: http://patchwork.linux-mips.org/patch/625/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      22f1fdfd
    • W
      MIPS: Loongson 2F: Cleanup the #if clauses · 55045ff5
      Wu Zhangjin 提交于
      This patch adds two new kernel options: CPU_SUPPORTS_CPUFREQ and
      CPU_SUPPORTS_ADDRWINCFG to describe the new features of Loongons 2F and
      replaces the several ugly #if clauses by them.
      
      These two options will be utilized by the future loongson revisions and
      related drivers such as the coming Loongson 2F CPUFreq driver.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Cc: Wu Zhangjin <wuzhangjin@gmail.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      55045ff5
    • W
      MIPS: Lemote 2f: Enable legacy RTC driver · 21a41faa
      Wu Zhangjin 提交于
      Currently rtclib is not available on Loongson family machines but the
      legacy RTC driver works well on them.  Deselect RTC_LIB to allow the legacy
      RTC driver to be selected.
      
      The rtclib patch series
      
         http://www.linux-mips.org/cgi-bin/mesg.cgi?a=linux-mips&i=a91e34bf2595157830d599cb66becd52247b1819.1257383766.git.wuzhangjin%40gmail.com
      
      or, in patchworks:
      
         http://patchwork.linux-mips.org/patch/570/
         http://patchwork.linux-mips.org/patch/571/
         http://patchwork.linux-mips.org/patch/572/
      
      is eventually going to switch Lemote platforms to rtclib.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: zhangfx@lemote.com
      Cc: yanh@lemote.com 
      Cc: huhb@lemote.com
      Cc: Nicholas Mc Guire <hofrat@hofr.at>
      Cc: Arnaud Patard <apatard@mandriva.com>
      Cc: loongson-dev@googlegroups.com
      Cc: linux-mips@linux-mips.org
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      21a41faa
    • W
      MIPS: Loongson: Add basic Loongson 2F support · 6f7a251a
      Wu Zhangjin 提交于
      Loongson 2F has built-in DDR2 and PCI-X controller. The PCI-X controller
      has a programming interface similiar to the the FPGA northbridge used on
      Loongson 2E.
      
      The main differences between Loongson 2E and Loongson 2F include:
      
      1. Loongson 2F has an extra address window configuration module, which
         is used to map CPU address space to DDR or PCI address space, or map
         the PCI-DMA address space to DDR or LIO address space.
      
      2. Loongson 2F supports 8 levels of software configurable CPu frequency
         which can be configured in the LOONGSON_CHIPCFG0 register.  The coming
         cpufreq and standby support are based on this feature.
      
      Loongson.h abstracts the modules and corresponding methods are abstracted.
      
      Add other Loongson-2F-specific source code including gcc 4.4 support, PCI
      memory space, PCI IO space, DMA address.
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Cc: linux-mips@linux-mips.org
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      6f7a251a
    • R
      MIPS: Remove addinitrd and CONFIG_PROBE_INITRD_HEADER · 32028f1f
      Ralf Baechle 提交于
      Addinitrd has been superseded by initramfs ages ago.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      32028f1f
    • D
      MIPS: Put PGD in C0_CONTEXT for 64-bit R2 processors. · 82622284
      David Daney 提交于
      Processors that support the mips64r2 ISA can in four instructions
      convert a shifted PGD pointer stored in the upper bits of c0_context
      into a usable pointer.  By doing this we save a memory load and
      associated potential cache miss in the TLB exception handlers.
      
      Since the upper bits of c0_context were holding the CPU number, we
      move this to the upper bits of c0_xcontext which doesn't have enough
      bits to hold the PGD pointer, but has plenty for the CPU number.
      Signed-off-by: NDavid Daney <ddaney@caviumnetworks.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      82622284
    • W
      MIPS: Add support for GZIP / BZIP2 / LZMA compressed kernel images · 1b93b3c3
      Wu Zhangjin 提交于
      This patch helps to generate smaller kernel images for linux-MIPS,
      
      Here is the effect when using lzma:
      
      $ ls -sh vmlinux
      7.1M vmlinux
      $ ls -sh vmlinuz
      1.5M vmlinuz
      
      Have tested the 32bit kernel on Qemu/Malta and 64bit kernel on FuLoong
      Mini PC. both of them work well. and also, tested by Alexander Clouter
      on an AR7 based Linksys WAG54Gv2, and by Manuel Lauss on an Alchemy
      board.
      
      This -v2 version incorporate the feedback from Ralf, and add the
      following changes:
      
      1. add .ecoff, .bin, .erec format support
      2. only enable it and the debug source code for the machines we tested
      3. a dozen of fixups and cleanups
      
      and if you want to enable it for your board, please try to select
      SYS_SUPPORTS_ZBOOT for it, and if the board have an 16550 compatible
      uart, you can select SYS_SUPPORTS_ZBOOT_UART16550 directly. and then
      sending the relative patches to Ralf.
      Tested-by: NManuel Lauss <manuel.lauss@googlemail.com>
      Tested-by: NAlexander Clouter <alex@digriz.org.uk>
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      1b93b3c3
  4. 02 12月, 2009 3 次提交
  5. 14 11月, 2009 1 次提交
  6. 02 11月, 2009 2 次提交
  7. 18 9月, 2009 6 次提交
  8. 03 7月, 2009 5 次提交
  9. 25 6月, 2009 3 次提交
  10. 17 6月, 2009 1 次提交