From owner-svn-src-user@FreeBSD.ORG Thu Feb 23 05:13:47 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37D64106566C; Thu, 23 Feb 2012 05:13:47 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A7C88FC12; Thu, 23 Feb 2012 05:13:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1N5DkLT084975; Thu, 23 Feb 2012 05:13:46 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1N5DkKL084973; Thu, 23 Feb 2012 05:13:46 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201202230513.q1N5DkKL084973@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 23 Feb 2012 05:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232020 - user/jchandra/xlp-merge/sys/mips/nlm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2012 05:13:47 -0000 Author: jchandra Date: Thu Feb 23 05:13:46 2012 New Revision: 232020 URL: http://svn.freebsd.org/changeset/base/232020 Log: Fixes to the XLP startup code. Changes are: - Correct the order of calling init functions. - Fix up checking excluding reset area. - use correct mask for chip workaround Modified: user/jchandra/xlp-merge/sys/mips/nlm/xlp_machdep.c Modified: user/jchandra/xlp-merge/sys/mips/nlm/xlp_machdep.c ============================================================================== --- user/jchandra/xlp-merge/sys/mips/nlm/xlp_machdep.c Thu Feb 23 05:10:00 2012 (r232019) +++ user/jchandra/xlp-merge/sys/mips/nlm/xlp_machdep.c Thu Feb 23 05:13:46 2012 (r232020) @@ -127,7 +127,7 @@ xlp_setup_core(void) */ reg |= (1ull << 31); /* Clear S1RCM - A0 errata */ - reg &= ~0xeull; + reg &= ~0x1eull; nlm_mtcr(LSU_DEFEATURE, reg); reg = nlm_mfcr(SCHED_DEFEATURE); @@ -358,14 +358,14 @@ mips_init(void) mips_cpu_init(); cpuinfo.cache_coherent_dma = TRUE; pmap_bootstrap(); + mips_proc0_init(); + mutex_init(); #ifdef DDB kdb_init(); if (boothowto & RB_KDB) { kdb_enter("Boot flags requested debugger", NULL); } #endif - mips_proc0_init(); - mutex_init(); } unsigned int @@ -433,8 +433,12 @@ xlp_mem_init(void) /* first bar, start a bit after end */ if (base == 0) { - base = (vm_paddr_t)MIPS_KSEG0_TO_PHYS(&_end) + 0x20000; - lim = 0x0c000000; /* TODO : hack to avoid uboot packet mem */ + base = (vm_paddr_t)MIPS_KSEG0_TO_PHYS(&_end); + base = round_page(base) + 0x20000; /* round up */ + /* TODO : hack to avoid uboot packet mem, network + * interface will write here if not reset correctly + * by u-boot */ + lim = 0x0c000000; } if (base >= XLP_MEM_LIM) { printf("Mem [%d]: Ignore %#jx - %#jx\n", i, @@ -456,7 +460,7 @@ xlp_mem_init(void) * Exclude reset entry memory range 0x1fc00000 - 0x20000000 * from free memory */ - if (base <= 0x1fc00000 && (base + lim) > 0x1fc00000) { + if (base < 0x20000000 && lim > 0x1fc00000) { uint64_t base0, lim0, base1, lim1; base0 = base; @@ -542,6 +546,9 @@ platform_start(__register_t a0 __unused, /* setup for the startup core */ xlp_setup_mmu(); + /* Read/Guess/setup board information */ + nlm_board_info_setup(); + /* MIPS generic init */ mips_init(); @@ -549,7 +556,6 @@ platform_start(__register_t a0 __unused, * XLP specific post initialization * initialize other on chip stuff */ - nlm_board_info_setup(); xlp_pic_init(); mips_timer_init_params(xlp_cpu_frequency, 0);