/*
 * sound/soc/blackfin/bf5xx-ac97.h
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef _BF5XX_AC97_H
#define _BF5XX_AC97_H

/* Frame format in memory, only support stereo currently */
struct ac97_frame {
	u16 ac97_tag;		/* slot 0 */
	u16 ac97_addr;		/* slot 1 */
	u16 ac97_data;		/* slot 2 */
	u16 ac97_pcm_l;		/*slot 3:front left*/
	u16 ac97_pcm_r;		/*slot 4:front left*/
#if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT)
	u16 ac97_mdm_l1;
	u16 ac97_center;	/*slot 6:center*/
	u16 ac97_sl;		/*slot 7:surround left*/
	u16 ac97_sr;		/*slot 8:surround right*/
	u16 ac97_lfe;		/*slot 9:lfe*/
#endif
} __attribute__ ((packed));

/* Speaker location */
#define SP_FL		0x0001
#define SP_FR		0x0010
#define SP_FC		0x0002
#define SP_LFE		0x0020
#define SP_SL		0x0004
#define SP_SR		0x0040

#define SP_STEREO	(SP_FL | SP_FR)
#define SP_2DOT1	(SP_FL | SP_FR | SP_LFE)
#define SP_QUAD		(SP_FL | SP_FR | SP_SL | SP_SR)
#define SP_5DOT1	(SP_FL | SP_FR | SP_FC | SP_LFE | SP_SL | SP_SR)

#define TAG_VALID		0x8000
#define TAG_CMD			0x6000
#define TAG_PCM_LEFT		0x1000
#define TAG_PCM_RIGHT		0x0800
#define TAG_PCM_MDM_L1		0x0400
#define TAG_PCM_CENTER		0x0200
#define TAG_PCM_SL		0x0100
#define TAG_PCM_SR		0x0080
#define TAG_PCM_LFE		0x0040

void bf5xx_pcm_to_ac97(struct ac97_frame *dst, const __u16 *src, \
		size_t count, unsigned int chan_mask);

void bf5xx_ac97_to_pcm(const struct ac97_frame *src, __u16 *dst, \
		size_t count);

#endif
gi/linux/net-next.git/refs/?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>refs</a><a href='/cgit.cgi/linux/net-next.git/log/net/sched/act_csum.c'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/net/sched/act_csum.c?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>tree</a><a class='active' href='/cgit.cgi/linux/net-next.git/commit/net/sched/act_csum.c?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/net/sched/act_csum.c?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/net/sched/act_csum.c'>
<input type='hidden' name='id' value='c8f325a59cfc718d13a50fbc746ed9b415c25e92'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/commit/?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>root</a>/<a href='/cgit.cgi/linux/net-next.git/commit/net?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>net</a>/<a href='/cgit.cgi/linux/net-next.git/commit/net/sched?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>sched</a>/<a href='/cgit.cgi/linux/net-next.git/commit/net/sched/act_csum.c?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>act_csum.c</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='c8f325a59cfc718d13a50fbc746ed9b415c25e92'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'>
<tr><th>author</th><td>Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;</td><td class='right'>2017-02-01 17:45:02 +0000</td></tr>
<tr><th>committer</th><td>Ingo Molnar &lt;mingo@kernel.org&gt;</td><td class='right'>2017-02-01 21:17:49 +0100</td></tr>
<tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/net/sched/act_csum.c?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>c8f325a59cfc718d13a50fbc746ed9b415c25e92</a> (<a href='/cgit.cgi/linux/net-next.git/patch/net/sched/act_csum.c?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>patch</a>)</td></tr>
<tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>d53fbdac9d0781e39a13b2ac6b2bd258cf3b4140</a> /<a href='/cgit.cgi/linux/net-next.git/tree/net/sched/act_csum.c?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>net/sched/act_csum.c</a></td></tr>
<tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/net/sched/act_csum.c?id=bf29bddf0417a4783da3b24e8c9e017ac649326f'>bf29bddf0417a4783da3b24e8c9e017ac649326f</a> (<a href='/cgit.cgi/linux/net-next.git/diff/net/sched/act_csum.c?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92&amp;id2=bf29bddf0417a4783da3b24e8c9e017ac649326f'>diff</a>)</td></tr></table>
<div class='commit-subject'>efi/fdt: Avoid FDT manipulation after ExitBootServices()</div><div class='commit-msg'>Some AArch64 UEFI implementations disable the MMU in ExitBootServices(),
after which unaligned accesses to RAM are no longer supported.

Commit:

  abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel")

fixed an issue in the memory map handling of the stub FDT code, but
inadvertently created an issue with such firmware, by moving some
of the FDT manipulation to after the invocation of ExitBootServices().

Given that the stub's libfdt implementation uses the ordinary, accelerated
string functions, which rely on hardware handling of unaligned accesses,
manipulating the FDT with the MMU off may result in alignment faults.

So fix the situation by moving the update_fdt_memmap() call into the
callback function invoked by efi_exit_boot_services() right before it
calls the ExitBootServices() UEFI service (which is arguably a better
place for it anyway)

Note that disabling the MMU in ExitBootServices() is not compliant with
the UEFI spec, and carries great risk due to the fact that switching from
cached to uncached memory accesses halfway through compiler generated code
(i.e., involving a stack) can never be done in a way that is architecturally
safe.

Fixes: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel")
Signed-off-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Tested-by: Riku Voipio &lt;riku.voipio@linaro.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Cc: mark.rutland@arm.com
Cc: linux-efi@vger.kernel.org
Cc: matt@codeblueprint.co.uk
Cc: leif.lindholm@linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1485971102-23330-2-git-send-email-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>Diffstat</a> (limited to 'net/sched/act_csum.c')</div><table summary='diffstat' class='diffstat'>