Google covers handling mobile versions of websites in this blog post.
For Googlebot and Googlebot-Mobile, it does not matter what the URL
structure is as long as it returns exactly what a user sees too. For
example, if you redirect mobile users from www.example.com to
m.example.com, that will be recognized by Googlebot-Mobile and both
websites will be crawled and added to the correct index. In this case,
use a 301 redirect for both users and Googlebot-Mobile.
If you serve all types of content from www.example.com, i.e. serving
desktop-optimized content or mobile-optimized content from the same
URL depending on the User-agent, this will also lead to correct
crawling by Googlebot and Googlebot-Mobile. This is not considered
cloaking by Google.
It is worth repeating that regardless of URL structure, you must
correctly detect the User-agent as given by your users and
Googlebot-Mobile, and serve both the same content. Don’t forget to
keep the default content, the desktop-optimized content, for when an
unknown User-agent requests it.